Re: [xml] When will be xmlTextReaderReadString implemented



Daniel Veillard wrote:

  Hum shouldn't you expand first the given node before collecting the
children ? The fact that you're on a given node in the reader doesn't
mean all its children are available. Seems an xmlTextReaderDoExpand()
call is needed in case of an ELEMENT, wrong or right ?

Good catch. I didn't even know about xmlTextReaderDoExpand().

Here's a patch for my previous patch.
--- xmlreader.c.old     2005-01-28 18:29:55.000000000 +0100
+++ xmlreader.c 2005-01-28 18:30:00.000000000 +0100
@@ -1658,7 +1658,9 @@
            return(xmlStrdup(node->content));
        break;
     case XML_ELEMENT_NODE:
-       return xmlTextReaderCollectSiblings(node->children);
+       if (xmlTextReaderDoExpand(reader) != -1) {
+           return xmlTextReaderCollectSiblings(node->children);
+       }
     case XML_ATTRIBUTE_NODE:
        TODO
        break;


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