[xsd-users] Error in building the generated header due to XSD runtime version mismatch

William Canton stargate625 at gmail.com
Fri Mar 4 12:39:19 EST 2011


Hi Boris,

Thank you for pointing out the required Data element within the
EISSDescriptorType element.  Indeed, the Data element is required to be
non-empty once presented.

The XML document was generated from a tool and I just assumed that it was
created properly.  I tested the same document on Java platform and didn't
see any problem.  Java XML parser seems more lenient than the CodeSynthesis
parser in this regard.

William


On Fri, Mar 4, 2011 at 10:31 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> 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