[xsd-users] Error in building the generated header due to XSD
runtime version mismatch
Boris Kolpackov
boris at codesynthesis.com
Fri Mar 4 10:31:08 EST 2011
Hi William,
William Canton <stargate625 at gmail.com> writes:
> However, there is another problem though. The CodeSynthesis doesn't seem to
> be able to parse a valid XML document with optional field elements.
Your XML is invalid per your schema. EISSDescriptorType has the following
definition:
<xs:complexType name="EISSDescriptorType">
<xs:sequence>
<xs:element name="Data" type="DataType"/>
<xs:element name="BIFPlatform" type="BIFPlatformType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
...
</xs:complexType>
Which means that the Data element must be present in every EISSDescriptor
element.
I think you are confusing minOccurs="0" with empty content.
When you see something like this:
<EISS>
<!-- No mentioning of EISSDescriptor -->
...
</EISS>
Then the minOccurs="0" is at play here. However, if you see something
like this:
<EISS>
<EISSDescriptor/>
...
</EISS>
Then the element is present and the empty content must be allowed by the
element's type (EISSDescriptorType in this case). EISSDescriptorType clearly
does not allow empty content.
Boris
More information about the xsd-users
mailing list