stevedlawrence opened a new pull request, #1180:
URL: https://github.com/apache/daffodil/pull/1180

   Scalar and optional elements are both implemented in the infoset exactly the 
same as DIElements, the only real difference is optional elements might not 
appear in the infoset. Arrays on the other hand are implemented differently as 
a DIArray. Because of this, it adds complexity if we allow expression path 
steps that can ambiguously reference either an array or an optional. We 
currently allow this, but this complexity leads to bugs and thrown exceptions.
   
   In fact, in most cases ambiguously referencing an array or an optional 
doesn't even work since arrays need a predicate and optionals do not allow 
predicates. The only case it could potentially work is as the last step as an 
argument to a function like fn:count. The added complexity is not worth 
supporting this edge case.
   
   Instead of allowing this, we should instead only allow ambiguous paths steps 
to scalar and optional elements. This modifies the path step logic to enforce 
this. A step must now unambiguously reference an array or it must reference 
scalars/optionals.
   
   Note that this slightly affects the behavior of the fn:count() function. 
This function must still reference an array or optional as before, but it can 
now reference a scalar only if it is an ambiguous path that could also 
reference an optional. If the argument unambiguously references a scalar, it is 
an SDE as it was before. It can also no longer ambiguously reference an array 
or optional, but that was previously broken.
   
   DAFFODIL-2879


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to