Hello DFDL community,
I am trying to understand choiceLengthKind. Do you have a compelling use case
for it?
I tried the following for dfdl:choiceLengthKind="explicit"
The input contains a person's name. If the name is less than 10 characters,
then it's just the firstname. Otherwise, it's the firstname and last name.
<xs:element name="input">
<xs:complexType>
<xs:choice dfdl:choiceLengthKind="explicit">
<xs:element name="firstname" type="xs:string"
dfdl:choiceLength="10" />
<xs:element name="firstname-lastname" type="xs:string"
dfdl:choiceLength="20" />
</xs:choice>
</xs:complexType>
</xs:element>
For reasons I do not understand, the first choice (the firstname element) is
always selected.
This input:
John
Produces this XML:
<input>
<firstname>John</firstname>
</input>
And this input:
John Alexander Smith
Produces this XML:
<input>
<firstname>John Alexander Smith</firstname>
</input>
Why is that?
/Roger