[xsde-users] Load Xml and Parse error

許峻翊 gen.i.shu at gmail.com
Thu Nov 25 22:32:49 EST 2021


             Thanks for your reply. The reason is about xml in not match
for xsd file.
             And I also face the other problem is about use XSD/e tool to
generate header file.
             XSD/e command:"cxx-hybrid --generate-parser
--generate-serializer --generate-aggregate  ABC.xsd"
             In ABC.xsd file I use "<xs:include schemaLocation="AAA.xsd">
to refence another xsd, and in ABC.hxx it will show "#include "AAA.hxx""
             And in pimpl.h and simpl.h will also show include
"AAA-pimpl.h" and include "AAA.-simpl.h" .
            But it looks like the XSD/e tool will not like visual studio
XSD.exe tool to help us auto generate the reference XSD  header file?





Boris Kolpackov <boris at codesynthesis.com> 於 2021年11月25日 週四 下午4:31寫道:

> 許峻翊 <gen.i.shu at gmail.com> writes:
>
> >      But when I exec the driver.exe it will have an error when code
> running
> > to  "doc_p.parse(argv[1])".
> >     The error is below
> >     "terminate called after throwing an instance of
> > 'xsde::cxx::parser::schema' what():  schema error".
> >      I have no idea what's wrong for this error message.
>
> This exception likely means that your XML document does not conform to
> your XML Schema. You can get more details if you catch the exception
> and print the information like in the library/driver.cxx example:
>
> catch (const xml_schema::parser_exception& e)
> {
>   cerr << input << ":" << e.line () << ":" << e.column () << ": "
>        << e.text () << endl;
>   return 1;
> }
>
> One common cause of this king of exception is getting the root element
> namespace (or lack thereof) wrong in this call:
>
> xml_schema::document_pimpl doc_p (
>   catalog_p.root_parser (),
>   catalog_p.root_namespace (),
>   catalog_p.root_name ());
>


More information about the xsde-users mailing list