[xsde-users] XML Serialization fails
Matthias Maschek
matthias.maschek at uma.at
Fri Mar 25 12:09:06 EDT 2011
Hi!
Yes, i meant parsing, the title was quite misleading, sorry!
Actually i used the commandline i had posted
xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd
And yes, my XSD and XML are using namespaces. The tip with using the third parameter is godd, i just can try it out on monday.
Thanks!
Matthias
----- Ursprüngliche Nachricht -----
Von: Boris Kolpackov <boris at codesynthesis.com>
Datum: Freitag, März 25, 2011 3:46 pm
Betreff: Re: [xsde-users] XML Serialization fails
An: Matthias Maschek <matthias.maschek at uma.at>
Cc: xsde-users at codesynthesis.com
> Matthias,
>
> Matthias Maschek <matthias.maschek at uma.at> writes:
>
> > I have a little problem with serialization. I generated the class
> files
> > via Hybrid like in the Hello World tutorial
> > (xsde cxx-hybrid --generate-parser --generate-aggregate my.xsd). After
> > that i tried to get the implementation running in my code. But when
> i
> > try to parse an XML i always get a unexpected element encountered
> > exception on the first contained element of the root element.
>
> Are you having problems with parsing or serialization? In the email's
> subject and at the beginning of the above paragraph you say serialization.
> In the last sentence you say parsing. Which one is it?
>
>
> > I tripple checked already the XML file against the XSD via validators
> > and there is no error. What i had problems with was the line from the
> > tutorial:
> > xml_schema::document_pimpl doc_p (hello_p.root_parser (),
> > hello_p.root_name ());
> >
> > document_pimpl did not exist in that namespace.
>
> That's very odd. What is the exact command line you used to compile
> the schema? If it includes --generate-parser and --generate-aggregate
> options, then xml_schema::document_pimpl should be defined in the
> -pimpl.hxx header file.
>
> Regarding the unexpected element error, if your schema uses namespaces
> (has targetNamespace attribute), then you also need to provide the
> root namespace to the parser:
>
> xml_schema::document_pimpl doc_p (hello_p.root_parser (),
> hello_p.root_namespace (),
> hello_p.root_name ());
>
> Boris
More information about the xsde-users
mailing list