[xsd-users] xsdcxx-musicxml
Mario Lang
mlang at delysid.org
Thu Dec 11 09:55:26 EST 2014
Boris Kolpackov <boris at codesynthesis.com> writes:
> Mario Lang <mlang at delysid.org> writes:
>
>> <xs:sequence>
>> <xs:choice>
>> <xs:sequence>
>> <xs:element name="a".../>
>> <xs:element name="c".../>
>> <xs:element name="d".../>
>> </xs:sequence>
>> <xs:sequence>
>> <xs:element name="b".../>
>> <xs:element name="c".../>
>> <xs:element name="e".../>
>> </xs:sequence>
>> <xs:sequence>
>> <xs:element name="c".../>
>> <xs:element name="d".../>
>> <xs:element name="e".../>
>> </xs:sequence>
>> </xs:choice>
>> <xs:element.../>...
>> </xs:sequence>
>
> To serialize, e.g., 'c' in the correct order, XSD would need to know
> which arm of the choice it is.
> Since XSD "flattens" choices, this is not possible in the current
> architecture. In this particular case you can kind of infer which arm
> it is based on which elements are present/absent. But that would be
> impossible to extend to the general case.
OK, thnaks, I trust your analysis on this one.
Just wanted to make sure we are not accidentally misunderatnding
eachotehr.
>> I have a feeling that all that is missing, is to fix the "sorting" order
>> of the flattened structure. Or, maybe, to detect identical elements in
>> a choice of sequences. Because, in the <choice> above, <c> is *always*
>> required to be present, <a> and <b> are mutually exclusive, and <d> and
>> <e> are only allowed if one of <a> or <b> is present. Again, to me, it
>> looks like the serialization order is rather unambigious from the
>> grammar given.
>
> I would suggest that you customize the serializer operator for this
> type. Implementing this in XSD will be non-trivial, to put it mildly.
OK. A customization works as well for me.
http://github.com/mlang/xsdcxx-musicxml/
--
CYa,
⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
.''`. | Get my public key via finger mlang/key at db.debian.org
: :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
`. `'
`- <URL:http://delysid.org/> <URL:http://www.staff.tugraz.at/mlang/>
More information about the xsd-users
mailing list