[xsde-users] Load Xml and Parse error

Boris Kolpackov boris at codesynthesis.com
Thu Nov 25 03:31:28 EST 2021


許峻翊 <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