I've been taking a look at this bug and am trying to figure out what the 
correct behavior for this situation would be.  Currently, attempting to call 
dfdlx:lookAhead as part of an expression for the default value of a 
newVariableInstance will result in a UsageError being thrown when attempting to 
get the bitOrder, as the VariableRuntimeData is descended from 
NonTermRuntimeData.

It doesn't seem unreasonable to want to use lookAhead from inside a 
newVariableInstance, but I'm not sure there is an easy way to get the parent 
sequence/element that contains the annotation where the newVariableInstance is 
defined.  I noticed that for elements when the expression for byteOrder isn't 
defined, it just defaults to BigEndian with comments stating that this likely 
means that the element is likely hexBinary, in which case the byte order should 
be ignored.  I don't know if it makes sense to do something like this and just 
defauilt bitOrder for VariableRuntimeData's to MSBF, as from the examples of 
lookAhead that I've seen involve looking into a hexBinary element.

Thoughts?

Josh

Reply via email to