<xs:element
name="choiceGroup" dfdl:lengthKind="implicit">
<xs:complexType>
<xs:choice
dfdl:choiceLengthKind="implicit" dfdl:initiatedContent="yes">
<xs:element name="myNum1" type="xs:int"
dfdl:lengthKind="explicit"
dfdl:length="2"
dfdl:textNumberPattern="#0"
dfdl:initiator="num:"
dfdl:terminator="~" />
>
<xs:element name="myText1" type="xs:string"
dfdl:lengthKind="explicit"
dfdl:length="2"
dfdl:initiator="text:"
dfdl:terminator="~" />
</xs:choice>
</xs:complexType>
</xs:element>
The above model is a choice of two elements,
each of which is fixed length and has an initiator and terminator. Because
the elements are fixed length, I must set dfdl:emptyValueDelimiterPolicy
(EVDP) to be 'none' **. I also want to discriminate using
the initiator, so I set dfdl:initiatedContent 'yes' on the choice, so I
must set EVDP to 'initiator' or 'both' ++. (Same for NVDP
if nillable). Catch 22.
** 'none' because
the only valid empty representation is that there is nothing there at all.
The element is fixed length X, so if the delimiters are present then the
content must be length X and can't be zero length.
++ 'initiator' or 'both' because
an initiator must always be present when dfdl:initiatedContent 'yes'.
The implication is that I can't use
dfdl:initiatedContent for this choice. While I can switch off nillable
to avoid the error with NVDP, there is no other way of avoiding the EVDP
error.
Regards
Steve Hanson
Architect, IBM
DFDL
Co-Chair, OGF
DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
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