[xsd-users] File-per-type Code Generation

Boris Kolpackov boris at codesynthesis.com
Thu Jul 17 14:05:28 EDT 2008


Hi Rance,

rakirtley at bellsouth.net <rakirtley at bellsouth.net> writes:

> First let me say that (IMHO as a new user) XSD is a terrific product, a 
> great time-saver for anyone working with XML based apps and well 
> positioned in the marketplace.  In other words, I wish I'd thought of it.

Thanks, I am glad you enjoy it :-).

> I've encountered what appears to be a bad behavior with C++/Tree when 
> using the file-per-type code generation option.  I have a schema which
> includes a recursive relationship.  When I do single file code generation,
> everything gets generated correctly.  When I use the file-per-type option
> xsd consumes resources until it aborts.  I did a work around where I
> change the recursive element to a simple type, generate code then modify
> the generated code manually to restore the correct relationship.  Here
> is the schema snippet that causes the problem:
>
>   <xs:complexType name="FunctionType">
>     <xs:sequence>
>       <xs:choice>
>         <xs:element name="OperatorName" type="OperatorType" />
>         <xs:element name="ComputeName" type="NameType" />
>       </xs:choice>
>       <xs:choice minOccurs="0" maxOccurs="unbounded">
>         <xs:element name="ValuePath" type="ValuePathType" />
>         <xs:element name="Function" type="FunctionType" />
>       </xs:choice>
>     </xs:sequence>
>   </xs:complexType>

I confirm there is a bug in 3.1.0 that it triggered by this schema
in the file-per-type mode. It was also already fixed for the upcoming
3.1.1. If you would like to verify this on your schema or if you need
the fix, here are the recent pre-release binaries for Windows and 
GNU/Linux:

http://www.codesynthesis.com/~boris/tmp/xsd-3.1.1.a7-i686-windows.zip
http://www.codesynthesis.com/~boris/tmp/xsd-3.1.1.a7-i686-linux-gnu.tar.bz2


> Not a problem for me, but I figured I should at least report it.

Thanks, we appreciate bug reports very much!

Boris




More information about the xsd-users mailing list