[Xml-compile] bug(s) in compilation of a "choice" element?
Mark Overmeer
mark at overmeer.net
Sat Feb 6 00:05:58 GMT 2010
* Oliver Gorwits (oliver.gorwits at oucs.ox.ac.uk) [100205 22:35]:
> error: required value for element `DistinguishedFolderId' missing...
> Which puzzles me even more because I'd expect XML::Compile to be
> asking for cho_DistinguishedFolderId instead, at least.
>
> Of course you could be right in that I'm possibly misinterpreting
> how the data structure needs to look for the choice element I quoted.
There is a problem to get these
<sequence minOccurs="0" maxOccurs="unbounded">
<choice minOccurs="0" maxOccurs="unbounded">
etc
in a Perl nested datastructure. Therefore, these get a label
which is the first element of the sequence/choice prepended by
seq_ resp cho_.
For instance, as schema:
<element name="a">
<choice maxOccurs="5">
<element name="b">
<element name="c">
</choice>
<element name="d">
An instance in Perl
{ a => 1
, cho_b => [ { c => 3 }, { b => 2}, { c => 42} ]
, d => 13
};
When maxOccurs <= 1, there is no need for such prefix or complexity.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list