[xsde-users] ios_base::failure exceptions when trying to parse

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Thu Jan 9 22:47:41 EST 2014


I have a new schema that I am trying to parse.  The tool generates code that compiles just fine, however when I try to parse a document I get exceptions.  Here is my parsing code:

void seiwg_platformstatusreport_p(const char * const xml)
{
  try
  {
    /* Parse */
    PlatformStatusReport_paggr psr_p;

    xml_schema::document_pimpl doc_p(psr_p.root_parser(),
        psr_p.root_namespace(), psr_p.root_name());

    psr_p.pre();

    doc_p.parse(xml); // <<------EXCEPTION THROWN HERE!!!

    auto_ptr<PlatformStatusReport> psr(psr_p.post());
  }
  catch (const xml_schema::parser_exception& e)
  {
    cerr << xml << ":" << e.line() << ":" << e.column() << ": " << e.text()
        << endl;
    return;
  }
  catch (const xml_schema::serializer_exception& e)
  {
    cerr << "error: " << e.text() << endl;
    return;
  }
  catch (const std::ios_base::failure&) // <<------THIS EXCEPTION IS THROWN!!
  {
    cerr << xml << ": unable to open or read/write failure" << endl;
    return;
  }
  catch (...)
  {
    cerr << xml << ": unhandled exception" << endl;
    return;
  }

  return;
} /* seiwg_platformstatusreport_p() */


And here is the document:

<?xml version="1.0" encoding="UTF-8"?>
<PlatformStatusReport>
</PlatformStatusReport>


When I generate code, here is the command used:

xsde cxx-hybrid --generate-inline  --generate-parser --generate-serializer \
--generate-aggregate --root-element PlatformStatusReport --output-dir SEIWG \
SEIWG/PlatformStatusReport.xsd


Any ideas why I am seeing those ios_base exceptions?  I can't even step into the doc_p.parse() routine to try and find out what is up.  It's almost like the doc_p is not getting created correctly.

Unfortunately I am unable to share the XSD files to show the schema, so hopefully this is a simple issue that is easily resolved.

Thanks!
Jon


--
Jonathan R. Haws
Embedded Engineer
Space Dynamics Laboratory
(435) 713-3489
jhaws at sdl.usu.edu





More information about the xsde-users mailing list