Re: libxml++: interactive read state loop



The documentation of the underlying libxml2 package at xmlsoft.org refers to http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html for description of node types.
Node type None:

This is returned by the XmlReader if a read method has not been called or if no more nodes are available to be read.

That description does not seem to fit with your code snippet, where reader->read() should return false when there is nothing more to read.

If you can provide a complete, but small, compilable test case, including input data, I can try to see what's happening and why.

I got your post yesterday, 2 weeks after it was sent. Don't you subscribe to libxmlplusplus-list? If you haven't registered as a subscriber, your posts may be severely delayed.

Kjell

2014-02-25 09:33, Aleksei Artemev skrev:
Hi team,

  I've recently got an issue with indefinite loop in a TextReader mode. Following abstract user code applies:
 while (reader->read()) {
       switch (reader->get_node_type()) {
             case xmlpp::TextReader::Element:
                ....
              case xmlpp::TextReader::EndElement:
                ....
              case xmlpp::TextReader::Text:
                ....
                 default: // all other things
                    ;
      }
 }

As you can see it does nothing if node type is None (this is true in case read state in Interactive). The problem is reader->read() returns true if I want to skip node with type None.

My questions are:
1. How TextReader can enter Interactive state and what does it mean?
2. What is the node type None? How to handle it properly?
3. Main question, if this is a BUG or a correct behavior when read() returns true and causes indefinite loop.

FYI: we are running SOAP server processing 3PP SOAP requests.

Hope for answer guys since this is major thing we met in our environment! Thanks in advance!

Aleksei.


_______________________________________________
libxmlplusplus-list mailing list
libxmlplusplus-list gnome org
https://mail.gnome.org/mailman/listinfo/libxmlplusplus-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]