* xmlTextReaderNext: * @reader: the xmlTextReaderPtr used * * Skip to the node following the current one in document order while * avoiding the subtree if any. * * Returns 1 if the node was read successfully, 0 if there is no more * nodes to read, or -1 in case of error */
| 1587 | * nodes to read, or -1 in case of error |
| 1588 | */ |
| 1589 | int |
| 1590 | xmlTextReaderNext(xmlTextReaderPtr reader) { |
| 1591 | int ret; |
| 1592 | xmlNodePtr cur; |
| 1593 | |
| 1594 | if (reader == NULL) |
| 1595 | return(-1); |
| 1596 | if (reader->doc != NULL) |
| 1597 | return(xmlTextReaderNextTree(reader)); |
| 1598 | cur = reader->node; |
| 1599 | if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) |
| 1600 | return(xmlTextReaderRead(reader)); |
| 1601 | if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK) |
| 1602 | return(xmlTextReaderRead(reader)); |
| 1603 | if (cur->extra & NODE_IS_EMPTY) |
| 1604 | return(xmlTextReaderRead(reader)); |
| 1605 | do { |
| 1606 | ret = xmlTextReaderRead(reader); |
| 1607 | if (ret != 1) |
| 1608 | return(ret); |
| 1609 | } while (reader->node != cur); |
| 1610 | return(xmlTextReaderRead(reader)); |
| 1611 | } |
| 1612 | |
| 1613 | #ifdef LIBXML_WRITER_ENABLED |
| 1614 | static void |
nothing calls this directly
no test coverage detected