[DFDL-WG] clarify array expressions

Steve Hanson smh at uk.ibm.com
Fri Feb 15 03:45:25 EST 2013


You are correct on the first point - array steps must be indexed. 

I am happy to allow dfdl:occursCount() to work with non-array elements, so 
it could return 0 or 1 for an optional element. That's more elegant than 
casting the result of fn:exists() if you want an integer result. It is 
also consistent in that you can use dfdl:occursCount() wherever you have 
used dfdl:occursCountKind property.

Regards

Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     dfdl-wg at ogf.org, 
Date:   14/02/2013 21:42
Subject:        [DFDL-WG] clarify array expressions
Sent by:        dfdl-wg-bounces at ogf.org




Some folks are trying to create a DFDL model for IMF (internet message 
format ... basically email)

There is this header structure which really wants unordered sequences. 
Since we don't have those yet
I told them to use an array of choice like this:

<xs:element name="hdrArray" minOccurs="1" maxOccurs="25">
   <xs:complexType>
     <xs:choice>
        <xs:element ref="TO_HDR"/>
        <xs:element ref="FROM_HDR" />
     </xs:choice>
     ...

But then there are these contraints, like there should be only one FROM 
address, but there can be several TO addresses.

So,  one might want to write a DFDL expression using an XPath-like query 
path in it. E.g., 

<xs:assert>{ dfdl:occursCount( hdrArray/FROM_HDR ) eq 1 }</xs:assert>


Here's the question: Is the DFDL expression in this assert legal? 

I advised them that no, it is not, because hdrArray is an array and isn't 
being indexed, while FROM_HDR is not an array, but is being used as the 
argument to dfdl:occursCount.

I think DFDL's expression language is simply not powerful enough to 
express these constraints. 

I'm just looking for affirmation or discussion if there is more to say 
here. 
--
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  https://www.ogf.org/mailman/listinfo/dfdl-wg

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130215/6f50a024/attachment.html>


More information about the dfdl-wg mailing list