[DFDL-WG] OR operator in DFDL Expressions

Mike Beckerle mbeckerle.dfdl at gmail.com
Wed Sep 17 04:05:04 EDT 2014


This is really a question about how IBM's DFDL works, but I have to
introduce the topic:

XPath 2.0 says that implementations have freedom about whether these
expressions cause errors or not:

true() or error() = true() Let's call this the sequential semantics

true() or error() = error Let's call this the parallel semantics

error() or true() = true Let's call this the bizarre semantics

There are analogous cases for 'and' with false()

Saxon, which dates from XPath 1.0, implements the sequential semantics,
which is required by XPath 1.0, and so that's what the various TDML tests
and such that we have in the Daffodil project have come to depend on. Quite
often we have things like

dfdl:occursIndex() = 1
or
../r[dfdl:occursIndex() - 1]/flag

where that 2nd operand is effectively an error if the first operand is
true.

Strictly by the new XPath 2.0 rules, the only portable way to write this
expression is with an if-then-else. But I am reluctant to change all these
tests we have.

Part of me says the most conservative thing is the parallel semantics -
because it prevents you from writing an OR statement like the one I have
above that depends on the sequentiality.

It is probably more important that the initial implementations are
consistent so that schemas are more likely to interoperate.

What does IBM DFDL do for the semantics of the OR expressions?

Thanks

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology |
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are
subject to the OGF Intellectual Property Policy
<http://www.ogf.org/About/abt_policies.php>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20140917/65d9f744/attachment.html>


More information about the dfdl-wg mailing list