Description
At some point people started writing expressions involving 'self' that is like ".[1]".
This may be due to a daffodil bug (current or since resolved) that required this if the current element is declared as an array or optional.
This should not be necessary. If our schema compiler requires ".[1]" on array/optional element expresions, that is a bug.
Even if an element is declared optional or array, the expression "." evaluated on that element is not referring to the whole array, but to the current individual node.
The expression ".[1]" is exactly equivalent to "." and so a warning should be issued by the schema compiler if any expression is written like ".[...anything ...]".
This needs to be a warning because portable DFDL actually does allow this. That's becasue to simplify implementations the DFDL expression language was defined so that it's possible to implement it via minor mods to an existing XPath implementation.