[DFDL-WG] clarification on dfdl:occursIndex() function

Mike Beckerle mbeckerle.dfdl at gmail.com
Mon Jul 28 18:27:26 EDT 2014


This function says it can be called on non-array elements. However, it does
not say what the result is.

If called when "." is not itself an array element there are only two
possible behaviors consistent with the fact that it is explicitly allowed
on non-array elements.

The result has to be either

(a) 1
(b) the occursIndex of the nearest enclosing array parent, or 1 if there is
no enclosing array parent.

I claim (a) is fairly pointless. You will just end up having to create
newVariableInstances to carry the array current index downward into
expressions.

I cannot think of a use case where one would want to call occursIndex()
polymorphically, i.e., where you want a number in the case of an array, but
1 otherwise.

So (b) is the preferable behavior.


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/20140728/9930e5cb/attachment.html>


More information about the dfdl-wg mailing list