MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / xmlTextReaderRead

Function xmlTextReaderRead

Externals/LibXML/xmlreader.c:1232–1473  ·  view source on GitHub ↗

* xmlTextReaderRead: * @reader: the xmlTextReaderPtr used * * Moves the position of the current instance to the next node in * the stream, exposing its properties. * * Returns 1 if the node was read successfully, 0 if there is no more * nodes to read, or -1 in case of error */

Source from the content-addressed store, hash-verified

1230 * nodes to read, or -1 in case of error
1231 */
1232int
1233xmlTextReaderRead(xmlTextReaderPtr reader) {
1234 int val, olddepth = 0;
1235 xmlTextReaderState oldstate = XML_TEXTREADER_START;
1236 xmlNodePtr oldnode = NULL;
1237
1238
1239 if (reader == NULL)
1240 return(-1);
1241 reader->curnode = NULL;
1242 if (reader->doc != NULL)
1243 return(xmlTextReaderReadTree(reader));
1244 if (reader->ctxt == NULL)
1245 return(-1);
1246 if (reader->ctxt->wellFormed != 1)
1247 return(-1);
1248
1249#ifdef DEBUG_READER
1250 fprintf(stderr, "\nREAD ");
1251 DUMP_READER
1252#endif
1253 if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
1254 reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
1255 /*
1256 * Initial state
1257 */
1258 do {
1259 val = xmlTextReaderPushData(reader);
1260 if (val < 0){
1261 reader->mode = XML_TEXTREADER_MODE_ERROR;
1262 reader->state = XML_TEXTREADER_ERROR;
1263 return(-1);
1264 }
1265 } while ((reader->ctxt->node == NULL) &&
1266 ((reader->mode != XML_TEXTREADER_MODE_EOF) &&
1267 (reader->state != XML_TEXTREADER_DONE)));
1268 if (reader->ctxt->node == NULL) {
1269 if (reader->ctxt->myDoc != NULL) {
1270 reader->node = reader->ctxt->myDoc->children;
1271 }
1272 if (reader->node == NULL){
1273 reader->mode = XML_TEXTREADER_MODE_ERROR;
1274 reader->state = XML_TEXTREADER_ERROR;
1275 return(-1);
1276 }
1277 reader->state = XML_TEXTREADER_ELEMENT;
1278 } else {
1279 if (reader->ctxt->myDoc != NULL) {
1280 reader->node = reader->ctxt->myDoc->children;
1281 }
1282 if (reader->node == NULL)
1283 reader->node = reader->ctxt->nodeTab[0];
1284 reader->state = XML_TEXTREADER_ELEMENT;
1285 }
1286 reader->depth = 0;
1287 reader->ctxt->parseMode = XML_PARSE_READER;
1288 goto node_found;
1289 }

Callers 13

streamFileFunction · 0.85
walkDocFunction · 0.85
test_xmlTextReaderReadFunction · 0.85
handleFileFunction · 0.85
xmlTextReaderNextFunction · 0.85
xmlSchemaVReaderWalkFunction · 0.85
streamProcessTestFunction · 0.85
patternTestFunction · 0.85
streamFileFunction · 0.85
extractFileFunction · 0.85
processDocFunction · 0.85

Calls 10

xmlTextReaderReadTreeFunction · 0.85
xmlTextReaderPushDataFunction · 0.85
xmlTextReaderValidatePopFunction · 0.85
xmlUnlinkNodeFunction · 0.85
xmlTextReaderFreeNodeFunction · 0.85
xmlParseChunkFunction · 0.85
xmlStrEqualFunction · 0.85
xmlXIncludeNewContextFunction · 0.85
xmlXIncludeSetFlagsFunction · 0.85
ifFunction · 0.70

Tested by 5

test_xmlTextReaderReadFunction · 0.68
handleFileFunction · 0.68
streamProcessTestFunction · 0.68
patternTestFunction · 0.68