[xsd-users] Problem in translating schema to C++ (following parser guide)

Boris Kolpackov boris at codesynthesis.com
Thu Jul 1 12:51:37 EDT 2010


Hi Pedro,

In the future please keep your replies CC'ed to the xsd-users mailing
list as discussed in the posting guidelines:

http://www.codesynthesis.com/support/posting-guidelines.xhtml


Pedro <pmonteirorocha at sapo.pt> writes:
    
> Hmm, I've tryed following that guide too, but I'm stuck at the "xsdcxx  
> cxx-tree hello.xsd". Same error. I have XSD 3.3.0.

Are you using xsdcxx Debian/Ubuntu package or are you using the
xsd package downloaded from the codesynthesis.com website? Can
you try to download the .tar.bz2 package and see if the 'xsd'
binary in the bin/ subdirectory works for you?

The error makes me think that there is some conflict between the 
g++ version (or, more precisely, libstdc++) that was used to build
xsdcxx and the version that you have installed on your box. You may
want to try to upgrade or downgrade libstdc++6 package and see if
this helps.


> I've installed xsd3.3.0 in Windows XP, and extracted the .cxx and 
> .hxx files with "xsd  cxx-parser --xml-parser expat hello.xsd" but
> I'm not sure those files can be used in windows and linux.

Yes, the files are the same on all platforms. Just make sure you
have the same version of XSD on both platforms (that is, using
3.3.0 on Windows and 3.2.0 on Linux won't work).


> Also, when i compile hello.xml with xsd, the result is a bit different  
> from the hello.xsd that the example shows:
>
> [...]
>
> and it gives me a few errors when I try to compile in windows xsd.exe.

This schema is invalid. Since it was generated with Mono's xsd.exe, I
am afraid I can't help you with that. You may want to contact the
Mono developers to report this problem.

Generally, thought, schemas that are auto-generated from a sample 
XML document are quite inaccurate. They usually require a lot of
manual editing to make them usable.

Boris



More information about the xsd-users mailing list