* xmlTextReaderDoExpand: * @reader: the xmlTextReaderPtr used * * Makes sure that the current node is fully read as well as all its * descendant. It means the full DOM subtree must be available at the * end of the call. * * Returns 1 if the node was expanded successfully, 0 if there is no more * nodes to read, or -1 in case of error */
| 1158 | * nodes to read, or -1 in case of error |
| 1159 | */ |
| 1160 | static int |
| 1161 | xmlTextReaderDoExpand(xmlTextReaderPtr reader) { |
| 1162 | int val; |
| 1163 | |
| 1164 | if ((reader == NULL) || (reader->node == NULL) || (reader->ctxt == NULL)) |
| 1165 | return(-1); |
| 1166 | do { |
| 1167 | if (PARSER_STOPPED(reader->ctxt)) |
| 1168 | return(1); |
| 1169 | |
| 1170 | if (xmlTextReaderGetSuccessor(reader->node) != NULL) |
| 1171 | return(1); |
| 1172 | if (reader->ctxt->nodeNr < reader->depth) |
| 1173 | return(1); |
| 1174 | if (reader->mode == XML_TEXTREADER_MODE_EOF) |
| 1175 | return(1); |
| 1176 | val = xmlTextReaderPushData(reader); |
| 1177 | if (val < 0){ |
| 1178 | reader->mode = XML_TEXTREADER_MODE_ERROR; |
| 1179 | reader->state = XML_TEXTREADER_ERROR; |
| 1180 | return(-1); |
| 1181 | } |
| 1182 | } while(reader->mode != XML_TEXTREADER_MODE_EOF); |
| 1183 | return(1); |
| 1184 | } |
| 1185 | |
| 1186 | /** |
| 1187 | * xmlTextReaderRead: |
no test coverage detected