[xsd-users] Tree Creation with Huge XSD Document Never Completing

Boris Kolpackov boris at codesynthesis.com
Thu Dec 11 14:45:09 EST 2008


Hi Jim,

james.lisle2 at wellsfargo.com <james.lisle2 at wellsfargo.com> writes:

> I am new to the xsd product and am using it on Suse10.2 and Solaris 10. I am
> attempting to generate a set of classes for a huge multi-file schema (15K
> elements across ~200 files) which have many include statements.
> 
> The command to generate output is: xsd cxx-tree --file-per-type <schema>.
> This kicks off the xsd process and it runs at 100% cpu indefinitely.  Are
> there any other options I might try to complete this process?

This is a fairly large schema and I would expect it to take minutes 
to compile in the file-per-type mode. This mode is significantly
slower than the file-per-schema mode because the XSD compiler 
generates a separate set of source files for each type.

If you are not using the latest version of XSD (3.2.0), then you may
want to upgrade since we fixed a problem that resulted in very long
compilation times for certain schemas in the file-per-type mode.

You can also generate the XML Schema namespace into a separate file
in order to speed up code generation:

$ xsd cxx-tree --generate-xml-schema xml-schema.xsd
$ xsd cxx-tree --extern-xml-schema xml-schema.xsd --file-per-type root.xsd

I would also suggest that you include the --show-sloc option to get
an idea about the progress. Once the schema parsing and processing
is complete, you should see some information for each generated
file. 

If none of this helps (e.g., you specified --show-sloc but don't
see any output for a long time, which means schema parsing/processing
is taking very long for some reason), then, if possible, we would
like to take a look at your schema (you can send it to me directly
to keep it private). This way we can run the profiler on XSD while
it is compiling your schemas and try to find the cause of the 
slowdown.

Boris




More information about the xsd-users mailing list