[studxml-users] parser fails to find next_expect as well as attribute

Oleg Kokorin ole2mail at mail.com
Mon Oct 18 13:00:03 EDT 2021


   hello all

   the library has been tested version
   libstudxml-1.0.1
   as well as latest from the
   https://git.codesynthesis.com/libstudxml/libstudxml.git

   the problem is, while parsing attached XML file

   using call
   next_expect (all types of content has been tested with the same
   exception failure):

           xml::parser p (metaStream, "metadataFinder");
           p.next_expect (xml::parser::start_element, "tt",
   xml::content::mixed);


   as well as using call
   attribute

           xml::parser p (metaStream, "metadataFinder");
           p.next_expect (xml::parser::start_element);
           std::cerr << p.line () << ':' << p.column () << ": start "
                << p.name () << " attributes: "
                << p.attribute("xml:lang") << std::endl;


   in both cases exception is happening for the unable to find element or
   attribute.

   however

   the example loop is working and is returning "tt" as the first and
   "head" as second.

          for (xml::parser::event_type e: p)
           {
               switch (e)
               {
                   default:
                       std::cerr << p.line () << ':' << p.column () << ":
   start "
                            << p.name () << std::endl;
                       break;
               }
           }

   thanks
   Oleg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: textStubXML.xml
Type: application/xml
Size: 18088 bytes
Desc: not available
Url : https://codesynthesis.com/pipermail/studxml-users/attachments/20211018/6e50afaf/textStubXML.xml


More information about the studxml-users mailing list