-
Improvement
-
Resolution: Unresolved
-
Normal
-
1.0.0
-
None
Expressions like
{ ../foo/bar eq 3 }
|
are very error prone. If node ../foo/bar doesn't exist you get a runtime Schema Definition Error, which is fatal, not backtrackable.
Really what is needed is:
{ if fn:exists(../foo/bar) then ../foo/bar eq 3 else daf:error("....") }
|
The DPath compiler should warn when a path is being used which may not exist, but is not wrapped in fn:exists(....) and if-then-else.
But that may really not be the right warning. Probably such expressions really should be moved to a location in the schema where the elements they are referring to simply must exist. E.g., if the expression was on element bar, or a sub-component within the schema of element bar, then the existence of element bar (and its parent foo) is implied and the expression can't get a runtime SDE.
See also related Bug DFDL-1278.