[studxml-users] Assertion failed: (p.event_ == characters), function characters_, file parser.cxx

Boris Kolpackov boris at codesynthesis.com
Wed Feb 18 08:42:10 EST 2015


Hi Maxim,

Maxim Maslennikov <maxim.maslennikov at gmail.com> writes:

> I wrote a small example to test the library and get assertion error.

The assertion is because of a bug in libstudxml. After fixing it and
uncommenting p.content(content::simple) calls in your test (necessary
to get character data accumulation), I was able to parse to the end
of the file where the unexpected attribute exception is thrown for
schemaLocation (because you haven't accessed this attribute and since
you are using the high-level attribute map feature, studxml checks
that everything is handled).

Here is one way to ignore all the unhandled attributes in the root
element:

p.next_expect(parser::start_element, "test", "root");
p.attribute_map (); // "Tell" studxml we have handled all attributes.

I am going to make a bug-fix release shortly. Thanks for the report
and the test!

Boris



More information about the studxml-users mailing list