[xsd-users] Problem in translating schema to C++ (following
parser guide)
Boris Kolpackov
boris at codesynthesis.com
Thu Jul 1 06:27:51 EDT 2010
Hi Pedro,
Pedro <pmonteirorocha at sapo.pt> writes:
> I'm not using the tree mapping because i need support for large xml files.
It is possible to use C++/Tree with large files (i.e., those that won't
fit into memory) with a bit of extra work. For larger schemas it may
still be easier than C++/Parser. For more information on this see the
'streaming' example in the examples/cxx/tree/ directory of the XSD
distribution (only available in XSD 3.3.0 or later).
> When i type "xsd" on the console, this is the result:
>
> xsd.exe - a utility for generating schema or class files
This is Mono's xsd.exe utility. If you are using the XSD package
from the Debian/Ubuntu/Fedora/etc repository, then the compiler
name is xsdcxx.
> ... but when I enter the command "xsdcxx cxx-parser --xml-parser
> expat hello.xsd" it returns "terminate called after throwing an instance
> of 'std::length_error' what(): basic_string::resize".
Hm, that's odd. I assume hello.xsd is the unmodified schema from the
guide, right? I just tried the following on my Debian box:
1. Install xsdcxx 3.2.0.1-1.1+b3 from the Debian testing repository.
2. Copy and paste the schema from Section 2.1 of the online guide to hello.xsd
3. Run xsdcxx cxx-parser --xml-parser expat hello.xsd
And everything works without any problems.
> I have reinstalled xsdcxx, I have updated everything, reinstalled
> xsd-3.3.0 from your website but I'm stuck at this point.
Do you get the same error with xsd-3.3.0? Can you send me the hello.xsd
schema that you are trying to compile?
Boris
More information about the xsd-users
mailing list