[xsd-users] Parsing the Collada 1.3.1 XSD

Boris Kolpackov boris at codesynthesis.com
Sat Dec 3 16:41:46 EST 2005


Lucas,

Lucas Magder <lucasmagder at rogers.com> writes:

> COLLADASchema.xsd:3079:29: ice: element 'node' is in unexpected condition

This appears to be a bug in xsd. The 'node' element was recursively
referencing itself and xsd was not prepared to handle such a case.
After fixing this bug I could compile the schema though there was
one more problem. Here is the relevant fragment (line 870):

<xs:element name="mesh">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="source" minOccurs="1" maxOccurs="unbounded"/>
      <xs:element ref="vertices" minOccurs="1" maxOccurs="1"/>
      <xs:element ref="source" minOccurs="0" maxOccurs="unbounded"/>

      ...

    </xs:sequence>

As you can see, there are two definitions of the 'source' element.
I am not sure if this is intentional or a typo. While it is valid per
XML Schema (though a questionable design), xsd does not yet support
such constructs. If I comment the second reference to 'source' out,
I can compile the schema and then compile the generated code without
any problems. BTW, the schema uses a lot of anonymous types and is
heavily recursive so to avoid code bloat I used --morph-anonymous
options:

$ xsd cxx-tree --morph-anonymous COLLADASchema.xsd


We are planning to release xsd 1.7.0 (which will include the fix for
the bug you found) in a couple of days. If you would like, I can also
send you a pre-release (just let me know if it is ok to send the .zip
via email).

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20051203/7ec852ee/attachment.pgp


More information about the xsd-users mailing list