[DFDL-WG] Why do occursCountKind=implicit and separatorSuppressionPolicy=never collide with unbounded?

Tim Kimber KIMBERT at uk.ibm.com
Fri Jul 19 04:40:12 EDT 2013


The rule makes it possible for a DFDL processor to identify which member 
it is parsing merely by counting separators. Without this rule, every 
position in a delimited group would be a point of uncertainty ( well, 
every position after the first variable-occurrence member of the group ). 

In your example, the variable-occurrence element is the final member of 
the group. The working group did discuss making an exception for this 
case, but we decided to keep the rule simple because this workaround 
exists:

     <xsd:element name="ContentType" dfdl:initiator="Content-Type:%SP;" 
dfdl:terminator="%CR;%LF;">
        <xsd:complexType>
            <xsd:sequence dfdl:separator=";" 
dfdl:separatorSuppressionPolicy="Never">
                <xsd:element name="MimeType" type="xsd:string"/>
                <xsd:sequence dfdl:separator=";" 
dfdl:separatorSuppressionPolicy="SuppressedAtEndLax">
                    <xsd:element name="Parameter" type="ParameterType" 
minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/>
                </xsd:sequence>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

regards,

Tim Kimber, DFDL Team,
Hursley, UK
Internet:  kimbert at uk.ibm.com
Tel. 01962-816742 
Internal tel. 37246742




From:   "Garriss Jr., James P." <jgarriss at mitre.org>
To:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>, 
Date:   18/07/2013 17:19
Subject:        [DFDL-WG] Why do occursCountKind=implicit and 
separatorSuppressionPolicy=never collide with unbounded?
Sent by:        dfdl-wg-bounces at ogf.org



The Content Type header can have multiple parameters, like so:
 
Content-Type: text/plain; charset=UTF-8; name=file.txt
 
I have defined the Content Type like so in DFDL:
 
    <xsd:element name="ContentType" dfdl:initiator="Content-Type:%SP;" 
dfdl:terminator="%CR;%LF;">
        <xsd:complexType>
            <xsd:sequence dfdl:separator=";">
                <xsd:element name="MimeType" type="xsd:string"/>
                <xsd:element name="Parameter" type="ParameterType" 
minOccurs="0" maxOccurs="unbounded" dfdl:occursCountKind="implicit"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
 
When I run this against a Content Type with 0 or 1 parameters, everything 
is good.  But when I run it with a Content Type header with two 
parameters, Daffodil throws this error:
 
2013-07-18 12:10:13:856 
edu.illinois.ncsa.daffodil.compiler.ProcessorFactory Error[Schema 
Definition Error: separatorSuppressionPolicy='never' with 
occursCountKind='implicit' required bounded maxOccurs.
Schema context: element.Parameter. Location line 23 column 180 in 
 
It seems that an element can’t have separatorSuppressionPolicy='never' and 
occursCountKind='implicit' if it’s unbounded. 
 
Why is this an issue?

TIA
 --
  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/20130719/9affe483/attachment-0001.html>


More information about the dfdl-wg mailing list