MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlTextReaderValidateEntity

Function xmlTextReaderValidateEntity

ThirdParty/libxml2/vtklibxml2/xmlreader.c:1041–1125  ·  view source on GitHub ↗

* xmlTextReaderValidateEntity: * @reader: the xmlTextReaderPtr used * * Handle the validation when an entity reference is encountered and * entity substitution is not activated. As a result the parser interface * must walk through the entity and do the validation calls */

Source from the content-addressed store, hash-verified

1039 * must walk through the entity and do the validation calls
1040 */
1041static int
1042xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
1043 xmlNodePtr oldnode = reader->node;
1044 xmlNodePtr node = reader->node;
1045
1046 do {
1047 if (node->type == XML_ENTITY_REF_NODE) {
1048 if ((node->children != NULL) &&
1049 (node->children->type == XML_ENTITY_DECL) &&
1050 (node->children->children != NULL)) {
1051 if (xmlTextReaderEntPush(reader, node) < 0) {
1052 if (node == oldnode)
1053 break;
1054 goto skip_children;
1055 }
1056 node = node->children->children;
1057 continue;
1058 } else {
1059 /*
1060 * The error has probably been raised already.
1061 */
1062 if (node == oldnode)
1063 break;
1064 goto skip_children;
1065 }
1066#ifdef LIBXML_REGEXP_ENABLED
1067 } else if (node->type == XML_ELEMENT_NODE) {
1068 reader->node = node;
1069 if (xmlTextReaderValidatePush(reader) < 0)
1070 return(-1);
1071 } else if ((node->type == XML_TEXT_NODE) ||
1072 (node->type == XML_CDATA_SECTION_NODE)) {
1073 xmlTextReaderValidateCData(reader, node->content,
1074 xmlStrlen(node->content));
1075#endif
1076 }
1077
1078 /*
1079 * go to next node
1080 */
1081 if (node->children != NULL) {
1082 node = node->children;
1083 continue;
1084 } else if (node->type == XML_ELEMENT_NODE) {
1085 if (xmlTextReaderValidatePop(reader) < 0)
1086 return(-1);
1087 }
1088skip_children:
1089 if (node->next != NULL) {
1090 node = node->next;
1091 continue;
1092 }
1093 do {
1094 node = node->parent;
1095 if (node->type == XML_ELEMENT_NODE) {
1096 xmlNodePtr tmp;
1097 if (reader->entNr == 0) {
1098 while ((tmp = node->last) != NULL) {

Callers 1

xmlTextReaderReadFunction · 0.85

Calls 8

xmlTextReaderEntPushFunction · 0.85
xmlStrlenFunction · 0.85
xmlTextReaderValidatePopFunction · 0.85
xmlUnlinkNodeFunction · 0.85
xmlTextReaderFreeNodeFunction · 0.85
xmlTextReaderEntPopFunction · 0.85

Tested by

no test coverage detected