[xsd-users] Too many anonymous types
Boris Kolpackov
boris at codesynthesis.com
Fri May 23 11:30:52 EDT 2008
Hi Brian,
Brian Young ARA/CFD <byoung at ara.com> writes:
> --file-per-type does work with the small/sample schema sent previously
> in this post. I followed the instructions for using XSD with Visual
> Studio.
>
> My original schema is currently one big file. Is there anyway to get
> more output from the code generator when running --file-per-type on a
> big schema? I do not see the created files (and SLOC) listed in the
> Visual Studio Output window as I do when running --file-per-type on the
> small/sample schema.
No, there is no other information produced by XSD. I was running XSD
in the --file-per-type mode with your options on schemas in our schema
repository. I found one biggish schema on which XSD runs out of 2GB of
memory. While it is expected that the compiler will use more memory when
--file-per-type is specified (internally it transforms the schema graph
"as if" each type was defined in a separate schema file) though it
shouldn't use that much memory. So I am going to investigate this. Can
you also check XSD memory usage while it is compiling your big schema
with --file-per-type? If it runs out of memory and the OS kills it then
that would explain the silent failure and no output.
I've also created a sample program to transform your schema:
http://www.codesynthesis.com/~boris/tmp/simplify.zip
I've decided to use XPath to make searching for nodes easier. So you
will need the following libraries to build it:
Xerces-C++ 2.8.0 http://xerces.apache.org/xerces-c/
XQilla 2.1.2 http://xqilla.sourceforge.net/HomePage
It also uses some XSD runtime headers to simplify string conversion,
parsing and serialization. I tested it on the sample schema you
provided (also included in the .zip file) and it seems to work well.
I didn't have much time so the code is a bit hairy. Let me know if you
have any questions/problems with it. Also it would be interesting to
know if this transformation had any noticeable impact on your schema.
Boris
More information about the xsd-users
mailing list