diff options
author | Felix Bùˆnemann <buenemann@louis.info> | 2018-06-23 12:14:28 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2018-09-01 14:32:25 +0200 |
commit | bfec41b3de1cbd35e547b57c80ae3a5101f8891c (patch) | |
tree | 6b3c3fe877bf6db2cc0c6e45f2c09681c422c4b9 /xmlreader.c | |
parent | d2ef114c6b0d9a840b94cdecf554a873fc6f6df5 (diff) | |
download | libxml2-bfec41b3de1cbd35e547b57c80ae3a5101f8891c.tar.gz |
Support xmlTextReaderNextSibling w/o preparsed doc
This implements missing support for readers that are not based on a
preparsed document in xmlTextReaderNextSibling.
Diffstat (limited to 'xmlreader.c')
-rw-r--r-- | xmlreader.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/xmlreader.c b/xmlreader.c index 05176c56..5aee3395 100644 --- a/xmlreader.c +++ b/xmlreader.c @@ -2025,7 +2025,6 @@ found_node: * * Skip to the node following the current one in document order while * avoiding the subtree if any. - * Currently implemented only for Readers built on a document * * Returns 1 if the node was read successfully, 0 if there is no more * nodes to read, or -1 in case of error @@ -2034,16 +2033,16 @@ int xmlTextReaderNextSibling(xmlTextReaderPtr reader) { if (reader == NULL) return(-1); - if (reader->doc == NULL) { - /* TODO */ - return(-1); - } if (reader->state == XML_TEXTREADER_END) return(0); - if (reader->node == NULL) - return(xmlTextReaderNextTree(reader)); + if (reader->node == NULL) { + if (reader->doc != NULL) + return(xmlTextReaderNextTree(reader)); + else + return(xmlTextReaderRead(reader)); + } if (reader->node->next != NULL) { reader->node = reader->node->next; |