[DFDL-WG] Why do occursCountKind=implicit and separatorSuppressionPolicy=never collide with unbounded?
Tim Kimber
KIMBERT at uk.ibm.com
Fri Jul 19 11:34:41 EDT 2013
Correct - that is exactly what I meant. I was mixing the new property name
with an old enumeration,
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: 19/07/2013 14:00
Subject: Re: [DFDL-WG] Why do occursCountKind=implicit and
separatorSuppressionPolicy=never collide with unbounded?
Sent by: dfdl-wg-bounces at ogf.org
Thanks, Tim, for the workaround, but according to the spec, that’s not a
legal value:
separatorSuppressionPolicy
Enum
Valid values ’never’, ‘anyEmpty’, ‘trailingEmpty’,‘trailingEmptyStrict’
Which explains why Daffodil is unhappy: Value 'suppressedAtEndLax' is not
facet-valid with respect to enumeration '[never, trailingEmpty,
trailingEmptyStrict, anyEmpty]'. It must be a value from the enumeration.
Perhaps you mean trailingEmpty instead of SuppressedAtEndLax?
From: dfdl-wg-bounces at ogf.org [mailto:dfdl-wg-bounces at ogf.org] On Behalf
Of Tim Kimber
Sent: Friday, July 19, 2013 4:40 AM
To: dfdl-wg at ogf.org
Subject: Re: [DFDL-WG] Why do occursCountKind=implicit and
separatorSuppressionPolicy=never collide with unbounded?
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
--
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/4fa50dc3/attachment-0001.html>
More information about the dfdl-wg
mailing list