33 xmlGenericError(xmlGenericErrorContext, \
34 "Unimplemented block at %s:%d\n", \
37#ifdef LIBXML_VALID_ENABLED
39xmlValidateAttributeValueInternal(xmlDocPtr doc, xmlAttributeType
type,
59 xmlParserCtxtPtr pctxt =
NULL;
63 channel = ctxt->error;
64 data = ctxt->userData;
68 pctxt = ctxt->userData;
75 "Memory allocation failed : %s\n",
extra);
80 "Memory allocation failed\n");
96 xmlParserCtxtPtr pctxt =
NULL;
100 channel = ctxt->error;
101 data = ctxt->userData;
105 pctxt = ctxt->userData;
120#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
140 xmlParserCtxtPtr pctxt =
NULL;
144 channel = ctxt->error;
145 data = ctxt->userData;
149 pctxt = ctxt->userData;
160#ifdef LIBXML_VALID_ENABLED
180 xmlParserCtxtPtr pctxt =
NULL;
184 channel = ctxt->error;
185 data = ctxt->userData;
189 pctxt = ctxt->userData;
218 xmlParserCtxtPtr pctxt =
NULL;
222 channel = ctxt->warning;
223 data = ctxt->userData;
227 pctxt = ctxt->userData;
239#ifdef LIBXML_REGEXP_ENABLED
249typedef struct _xmlValidState {
250 xmlElementPtr elemDecl;
252 xmlRegExecCtxtPtr exec;
258 if ((ctxt->vstateMax == 0) || (ctxt->vstateTab ==
NULL)) {
259 ctxt->vstateMax = 10;
261 sizeof(ctxt->vstateTab[0]));
262 if (ctxt->vstateTab ==
NULL) {
268 if (ctxt->vstateNr >= ctxt->vstateMax) {
272 2 * ctxt->vstateMax *
sizeof(ctxt->vstateTab[0]));
277 ctxt->vstateMax *= 2;
278 ctxt->vstateTab = tmp;
280 ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr];
281 ctxt->vstateTab[ctxt->vstateNr].elemDecl = elemDecl;
282 ctxt->vstateTab[ctxt->vstateNr].node =
node;
283 if ((elemDecl !=
NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
284 if (elemDecl->contModel ==
NULL)
285 xmlValidBuildContentModel(ctxt, elemDecl);
286 if (elemDecl->contModel !=
NULL) {
287 ctxt->vstateTab[ctxt->vstateNr].exec =
288 xmlRegNewExecCtxt(elemDecl->contModel,
NULL,
NULL);
290 ctxt->vstateTab[ctxt->vstateNr].exec =
NULL;
291 xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
293 "Failed to build content model regexp for %s\n",
297 return(ctxt->vstateNr++);
302 xmlElementPtr elemDecl;
304 if (ctxt->vstateNr < 1)
return(-1);
306 elemDecl = ctxt->vstateTab[ctxt->vstateNr].elemDecl;
307 ctxt->vstateTab[ctxt->vstateNr].elemDecl =
NULL;
308 ctxt->vstateTab[ctxt->vstateNr].node =
NULL;
309 if ((elemDecl !=
NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
310 xmlRegFreeExecCtxt(ctxt->vstateTab[ctxt->vstateNr].exec);
312 ctxt->vstateTab[ctxt->vstateNr].exec =
NULL;
313 if (ctxt->vstateNr >= 1)
314 ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr - 1];
317 return(ctxt->vstateNr);
332#define ROLLBACK_PARENT 1
334typedef struct _xmlValidState {
335 xmlElementContentPtr cont;
342#define MAX_RECURSE 25000
343#define MAX_DEPTH ((sizeof(_xmlValidState.occurs)) * 8)
344#define CONT ctxt->vstate->cont
345#define NODE ctxt->vstate->node
346#define DEPTH ctxt->vstate->depth
347#define OCCURS ctxt->vstate->occurs
348#define STATE ctxt->vstate->state
350#define OCCURRENCE (ctxt->vstate->occurs & (1 << DEPTH))
351#define PARENT_OCCURRENCE (ctxt->vstate->occurs & ((1 << DEPTH) - 1))
353#define SET_OCCURRENCE ctxt->vstate->occurs |= (1 << DEPTH)
354#define RESET_OCCURRENCE ctxt->vstate->occurs &= ((1 << DEPTH) - 1)
358 xmlNodePtr
node,
unsigned char depth,
long occurs,
359 unsigned char state) {
360 int i = ctxt->vstateNr - 1;
365 if (ctxt->vstateTab ==
NULL) {
368 ctxt->vstateMax *
sizeof(ctxt->vstateTab[0]));
369 if (ctxt->vstateTab ==
NULL) {
374 if (ctxt->vstateNr >= ctxt->vstateMax) {
378 2 * ctxt->vstateMax *
sizeof(ctxt->vstateTab[0]));
383 ctxt->vstateMax *= 2;
384 ctxt->vstateTab = tmp;
385 ctxt->vstate = &ctxt->vstateTab[0];
390 if ((
i >= 0) && (ctxt->vstateTab[
i].cont == cont) &&
391 (ctxt->vstateTab[
i].node ==
node) &&
392 (ctxt->vstateTab[
i].depth ==
depth) &&
393 (ctxt->vstateTab[
i].occurs == occurs) &&
394 (ctxt->vstateTab[
i].state ==
state))
395 return(ctxt->vstateNr);
396 ctxt->vstateTab[ctxt->vstateNr].cont = cont;
397 ctxt->vstateTab[ctxt->vstateNr].node =
node;
398 ctxt->vstateTab[ctxt->vstateNr].depth =
depth;
399 ctxt->vstateTab[ctxt->vstateNr].occurs = occurs;
400 ctxt->vstateTab[ctxt->vstateNr].state =
state;
401 return(ctxt->vstateNr++);
406 if (ctxt->vstateNr <= 1)
return(-1);
408 ctxt->vstate = &ctxt->vstateTab[0];
409 ctxt->vstate->cont = ctxt->vstateTab[ctxt->vstateNr].cont;
410 ctxt->vstate->node = ctxt->vstateTab[ctxt->vstateNr].node;
411 ctxt->vstate->depth = ctxt->vstateTab[ctxt->vstateNr].depth;
412 ctxt->vstate->occurs = ctxt->vstateTab[ctxt->vstateNr].occurs;
413 ctxt->vstate->state = ctxt->vstateTab[ctxt->vstateNr].state;
414 return(ctxt->vstateNr);
422 if (ctxt->nodeMax <= 0) {
426 sizeof(ctxt->nodeTab[0]));
427 if (ctxt->nodeTab ==
NULL) {
433 if (ctxt->nodeNr >= ctxt->nodeMax) {
435 tmp = (xmlNodePtr *)
xmlRealloc(ctxt->nodeTab,
436 ctxt->nodeMax * 2 *
sizeof(ctxt->nodeTab[0]));
444 ctxt->nodeTab[ctxt->nodeNr] =
value;
446 return (ctxt->nodeNr++);
453 if (ctxt->nodeNr <= 0)
456 if (ctxt->nodeNr > 0)
457 ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
460 ret = ctxt->nodeTab[ctxt->nodeNr];
461 ctxt->nodeTab[ctxt->nodeNr] =
NULL;
469 if (doc == NULL) return(0); \
470 else if ((doc->intSubset == NULL) && \
471 (doc->extSubset == NULL)) return(0)
473#ifdef LIBXML_REGEXP_ENABLED
492xmlValidBuildAContentModel(xmlElementContentPtr
content,
497 "Found NULL content in content model of %s\n",
502 case XML_ELEMENT_CONTENT_PCDATA:
504 "Found PCDATA in content model of %s\n",
508 case XML_ELEMENT_CONTENT_ELEMENT: {
509 xmlAutomataStatePtr oldstate = ctxt->state;
520 case XML_ELEMENT_CONTENT_ONCE:
521 ctxt->state = xmlAutomataNewTransition(ctxt->am,
524 case XML_ELEMENT_CONTENT_OPT:
525 ctxt->state = xmlAutomataNewTransition(ctxt->am,
527 xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
529 case XML_ELEMENT_CONTENT_PLUS:
530 ctxt->state = xmlAutomataNewTransition(ctxt->am,
532 xmlAutomataNewTransition(ctxt->am, ctxt->state,
535 case XML_ELEMENT_CONTENT_MULT:
536 ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
538 xmlAutomataNewTransition(ctxt->am,
546 case XML_ELEMENT_CONTENT_SEQ: {
547 xmlAutomataStatePtr oldstate, oldend;
548 xmlElementContentOccur ocur;
553 oldstate = ctxt->state;
555 if (ocur != XML_ELEMENT_CONTENT_ONCE) {
556 ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldstate,
NULL);
557 oldstate = ctxt->state;
560 xmlValidBuildAContentModel(
content->c1, ctxt,
name);
562 }
while ((
content->type == XML_ELEMENT_CONTENT_SEQ) &&
563 (
content->ocur == XML_ELEMENT_CONTENT_ONCE));
565 oldend = ctxt->state;
566 ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend,
NULL);
568 case XML_ELEMENT_CONTENT_ONCE:
570 case XML_ELEMENT_CONTENT_OPT:
571 xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
573 case XML_ELEMENT_CONTENT_MULT:
574 xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
575 xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
577 case XML_ELEMENT_CONTENT_PLUS:
578 xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
583 case XML_ELEMENT_CONTENT_OR: {
584 xmlAutomataStatePtr oldstate, oldend;
585 xmlElementContentOccur ocur;
588 if ((ocur == XML_ELEMENT_CONTENT_PLUS) ||
589 (ocur == XML_ELEMENT_CONTENT_MULT)) {
590 ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
593 oldstate = ctxt->state;
594 oldend = xmlAutomataNewState(ctxt->am);
601 ctxt->state = oldstate;
602 xmlValidBuildAContentModel(
content->c1, ctxt,
name);
603 xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
605 }
while ((
content->type == XML_ELEMENT_CONTENT_OR) &&
606 (
content->ocur == XML_ELEMENT_CONTENT_ONCE));
607 ctxt->state = oldstate;
609 xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
610 ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend,
NULL);
612 case XML_ELEMENT_CONTENT_ONCE:
614 case XML_ELEMENT_CONTENT_OPT:
615 xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
617 case XML_ELEMENT_CONTENT_MULT:
618 xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
619 xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
621 case XML_ELEMENT_CONTENT_PLUS:
622 xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
629 "ContentModel broken for element %s\n",
630 (
const char *)
name);
650 if (
elem->type != XML_ELEMENT_DECL)
652 if (
elem->etype != XML_ELEMENT_TYPE_ELEMENT)
656 if (!xmlRegexpIsDeterminist(
elem->contModel)) {
663 ctxt->am = xmlNewAutomata();
664 if (ctxt->am ==
NULL) {
665 xmlErrValidNode(ctxt, (xmlNodePtr)
elem,
667 "Cannot create automata for element %s\n",
671 ctxt->state = xmlAutomataGetInitState(ctxt->am);
672 xmlValidBuildAContentModel(
elem->content, ctxt,
elem->name);
673 xmlAutomataSetFinalState(ctxt->am, ctxt->state);
674 elem->contModel = xmlAutomataCompile(ctxt->am);
675 if (xmlRegexpIsDeterminist(
elem->contModel) != 1) {
679 xmlErrValidNode(ctxt, (xmlNodePtr)
elem,
681 "Content model of %s is not deterministic: %s\n",
685 xmlFreeAutomata(ctxt->am);
690 xmlFreeAutomata(ctxt->am);
754 xmlElementContentType
type) {
755 xmlElementContentPtr
ret;
762 case XML_ELEMENT_CONTENT_ELEMENT:
765 "xmlNewElementContent : name == NULL !\n",
769 case XML_ELEMENT_CONTENT_PCDATA:
770 case XML_ELEMENT_CONTENT_SEQ:
771 case XML_ELEMENT_CONTENT_OR:
774 "xmlNewElementContent : name != NULL !\n",
780 "Internal: ELEMENT content corrupted invalid type\n",
784 ret = (xmlElementContentPtr)
xmlMalloc(
sizeof(xmlElementContent));
789 memset(
ret, 0,
sizeof(xmlElementContent));
791 ret->ocur = XML_ELEMENT_CONTENT_ONCE;
796 tmp = xmlSplitQName3(
name, &
l);
849 ret = (xmlElementContentPtr)
xmlMalloc(
sizeof(xmlElementContent));
854 memset(
ret, 0,
sizeof(xmlElementContent));
878 tmp = (xmlElementContentPtr)
xmlMalloc(
sizeof(xmlElementContent));
883 memset(tmp, 0,
sizeof(xmlElementContent));
884 tmp->type =
cur->type;
885 tmp->ocur =
cur->ocur;
904 tmp->c1->parent = tmp;
944 xmlElementContentPtr
parent;
952 case XML_ELEMENT_CONTENT_PCDATA:
953 case XML_ELEMENT_CONTENT_ELEMENT:
954 case XML_ELEMENT_CONTENT_SEQ:
955 case XML_ELEMENT_CONTENT_OR:
959 "Internal: ELEMENT content corrupted invalid type\n",
1004#ifdef LIBXML_OUTPUT_ENABLED
1013xmlDumpElementOccur(xmlBufferPtr
buf, xmlElementContentPtr
cur) {
1014 switch (
cur->ocur) {
1015 case XML_ELEMENT_CONTENT_ONCE:
1017 case XML_ELEMENT_CONTENT_OPT:
1018 xmlBufferWriteChar(
buf,
"?");
1020 case XML_ELEMENT_CONTENT_MULT:
1021 xmlBufferWriteChar(
buf,
"*");
1023 case XML_ELEMENT_CONTENT_PLUS:
1024 xmlBufferWriteChar(
buf,
"+");
1037xmlDumpElementContent(xmlBufferPtr
buf, xmlElementContentPtr
content) {
1038 xmlElementContentPtr
cur;
1042 xmlBufferWriteChar(
buf,
"(");
1048 switch (
cur->type) {
1049 case XML_ELEMENT_CONTENT_PCDATA:
1050 xmlBufferWriteChar(
buf,
"#PCDATA");
1052 case XML_ELEMENT_CONTENT_ELEMENT:
1054 xmlBufferWriteCHAR(
buf,
cur->prefix);
1055 xmlBufferWriteChar(
buf,
":");
1057 xmlBufferWriteCHAR(
buf,
cur->name);
1059 case XML_ELEMENT_CONTENT_SEQ:
1060 case XML_ELEMENT_CONTENT_OR:
1063 ((
cur->type !=
cur->parent->type) ||
1064 (
cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
1065 xmlBufferWriteChar(
buf,
"(");
1070 "Internal: ELEMENT cur corrupted invalid type\n",
1075 xmlElementContentPtr
parent =
cur->parent;
1079 if (((
cur->type == XML_ELEMENT_CONTENT_OR) ||
1080 (
cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
1082 (
cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
1083 xmlBufferWriteChar(
buf,
")");
1084 xmlDumpElementOccur(
buf,
cur);
1087 if (
parent->type == XML_ELEMENT_CONTENT_SEQ)
1088 xmlBufferWriteChar(
buf,
" , ");
1089 else if (
parent->type == XML_ELEMENT_CONTENT_OR)
1090 xmlBufferWriteChar(
buf,
" | ");
1100 xmlBufferWriteChar(
buf,
")");
1142 case XML_ELEMENT_CONTENT_PCDATA:
1145 case XML_ELEMENT_CONTENT_ELEMENT: {
1150 if (
size -
len < qnameLen + 10) {
1162 case XML_ELEMENT_CONTENT_SEQ:
1163 if ((
content->c1->type == XML_ELEMENT_CONTENT_OR) ||
1164 (
content->c1->type == XML_ELEMENT_CONTENT_SEQ))
1175 if (((
content->c2->type == XML_ELEMENT_CONTENT_OR) ||
1176 (
content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
1177 (
content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
1182 case XML_ELEMENT_CONTENT_OR:
1183 if ((
content->c1->type == XML_ELEMENT_CONTENT_OR) ||
1184 (
content->c1->type == XML_ELEMENT_CONTENT_SEQ))
1195 if (((
content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
1196 (
content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
1197 (
content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
1207 case XML_ELEMENT_CONTENT_ONCE:
1209 case XML_ELEMENT_CONTENT_OPT:
1212 case XML_ELEMENT_CONTENT_MULT:
1215 case XML_ELEMENT_CONTENT_PLUS:
1236 xmlUnlinkNode((xmlNodePtr)
elem);
1242#ifdef LIBXML_REGEXP_ENABLED
1244 xmlRegFreeRegexp(
elem->contModel);
1265 xmlElementTypeVal
type,
1266 xmlElementContentPtr
content) {
1269 xmlAttributePtr oldAttributes =
NULL;
1280 case XML_ELEMENT_TYPE_EMPTY:
1283 "xmlAddElementDecl: content != NULL for EMPTY\n",
1288 case XML_ELEMENT_TYPE_ANY:
1291 "xmlAddElementDecl: content != NULL for ANY\n",
1296 case XML_ELEMENT_TYPE_MIXED:
1299 "xmlAddElementDecl: content == NULL for MIXED\n",
1304 case XML_ELEMENT_TYPE_ELEMENT:
1307 "xmlAddElementDecl: content == NULL for ELEMENT\n",
1314 "Internal: ELEMENT decl corrupted invalid type\n",
1322 uqname = xmlSplitQName2(
name, &
ns);
1333 if (dtd->doc !=
NULL)
1334 dict = dtd->doc->dict;
1336 dtd->elements = (
void *)
table;
1340 "xmlAddElementDecl: Table creation failed!\n");
1352 if ((dtd->doc !=
NULL) && (dtd->doc->intSubset !=
NULL)) {
1354 if ((
ret !=
NULL) && (
ret->etype == XML_ELEMENT_TYPE_UNDEFINED)) {
1355 oldAttributes =
ret->attributes;
1368 if (
ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
1369#ifdef LIBXML_VALID_ENABLED
1374 "Redefinition of element %s\n",
1398 ret->type = XML_ELEMENT_DECL;
1420#ifdef LIBXML_VALID_ENABLED
1425 "Redefinition of element %s\n",
1437 ret->attributes = oldAttributes;
1452 content->parent = (xmlElementContentPtr) 1;
1461 ret->doc = dtd->doc;
1462 if (dtd->last ==
NULL) {
1463 dtd->children = dtd->last = (xmlNodePtr)
ret;
1465 dtd->last->next = (xmlNodePtr)
ret;
1466 ret->prev = dtd->last;
1467 dtd->last = (xmlNodePtr)
ret;
1490#ifdef LIBXML_TREE_ENABLED
1501 xmlElementPtr
elem = (xmlElementPtr) payload;
1510 cur->type = XML_ELEMENT_DECL;
1540#ifdef LIBXML_OUTPUT_ENABLED
1550xmlDumpElementDecl(xmlBufferPtr
buf, xmlElementPtr
elem) {
1553 switch (
elem->etype) {
1554 case XML_ELEMENT_TYPE_EMPTY:
1555 xmlBufferWriteChar(
buf,
"<!ELEMENT ");
1557 xmlBufferWriteCHAR(
buf,
elem->prefix);
1558 xmlBufferWriteChar(
buf,
":");
1560 xmlBufferWriteCHAR(
buf,
elem->name);
1561 xmlBufferWriteChar(
buf,
" EMPTY>\n");
1563 case XML_ELEMENT_TYPE_ANY:
1564 xmlBufferWriteChar(
buf,
"<!ELEMENT ");
1566 xmlBufferWriteCHAR(
buf,
elem->prefix);
1567 xmlBufferWriteChar(
buf,
":");
1569 xmlBufferWriteCHAR(
buf,
elem->name);
1570 xmlBufferWriteChar(
buf,
" ANY>\n");
1572 case XML_ELEMENT_TYPE_MIXED:
1573 xmlBufferWriteChar(
buf,
"<!ELEMENT ");
1575 xmlBufferWriteCHAR(
buf,
elem->prefix);
1576 xmlBufferWriteChar(
buf,
":");
1578 xmlBufferWriteCHAR(
buf,
elem->name);
1579 xmlBufferWriteChar(
buf,
" ");
1580 xmlDumpElementContent(
buf,
elem->content);
1581 xmlBufferWriteChar(
buf,
">\n");
1583 case XML_ELEMENT_TYPE_ELEMENT:
1584 xmlBufferWriteChar(
buf,
"<!ELEMENT ");
1586 xmlBufferWriteCHAR(
buf,
elem->prefix);
1587 xmlBufferWriteChar(
buf,
":");
1589 xmlBufferWriteCHAR(
buf,
elem->name);
1590 xmlBufferWriteChar(
buf,
" ");
1591 xmlDumpElementContent(
buf,
elem->content);
1592 xmlBufferWriteChar(
buf,
">\n");
1596 "Internal: ELEMENT struct corrupted invalid type\n",
1610xmlDumpElementDeclScan(
void *
elem,
void *
buf,
1612 xmlDumpElementDecl((xmlBufferPtr)
buf, (xmlElementPtr)
elem);
1641 xmlEnumerationPtr
ret;
1643 ret = (xmlEnumerationPtr)
xmlMalloc(
sizeof(xmlEnumeration));
1671#ifdef LIBXML_TREE_ENABLED
1682xmlCopyEnumeration(xmlEnumerationPtr
cur) {
1683 xmlEnumerationPtr
ret;
1689 if (
cur->next !=
NULL)
ret->next = xmlCopyEnumeration(
cur->next);
1696#ifdef LIBXML_OUTPUT_ENABLED
1705xmlDumpEnumeration(xmlBufferPtr
buf, xmlEnumerationPtr
cur) {
1709 xmlBufferWriteCHAR(
buf,
cur->name);
1711 xmlBufferWriteChar(
buf,
")");
1713 xmlBufferWriteChar(
buf,
" | ");
1714 xmlDumpEnumeration(
buf,
cur->next);
1719#ifdef LIBXML_VALID_ENABLED
1733 xmlAttributePtr
cur;
1739 if (
cur->atype == XML_ATTRIBUTE_ID) {
1743 "Element %s has too many ID attributes defined : %s\n",
1764 dict =
attr->doc->dict;
1767 xmlUnlinkNode((xmlNodePtr)
attr);
1777 if ((
attr->defaultValue !=
NULL) &&
1815 xmlAttributeType
type, xmlAttributeDefault def,
1816 const xmlChar *defaultValue, xmlEnumerationPtr
tree) {
1817 xmlAttributePtr
ret;
1819 xmlElementPtr elemDef;
1834 if (dtd->doc !=
NULL)
1835 dict = dtd->doc->dict;
1837#ifdef LIBXML_VALID_ENABLED
1842 case XML_ATTRIBUTE_CDATA:
1844 case XML_ATTRIBUTE_ID:
1846 case XML_ATTRIBUTE_IDREF:
1848 case XML_ATTRIBUTE_IDREFS:
1850 case XML_ATTRIBUTE_ENTITY:
1852 case XML_ATTRIBUTE_ENTITIES:
1854 case XML_ATTRIBUTE_NMTOKEN:
1856 case XML_ATTRIBUTE_NMTOKENS:
1858 case XML_ATTRIBUTE_ENUMERATION:
1860 case XML_ATTRIBUTE_NOTATION:
1864 "Internal: ATTRIBUTE struct corrupted invalid type\n",
1869 if ((defaultValue !=
NULL) &&
1870 (!xmlValidateAttributeValueInternal(dtd->doc,
type, defaultValue))) {
1872 "Attribute %s of %s: invalid default value\n",
1874 defaultValue =
NULL;
1884 if ((dtd->doc !=
NULL) && (dtd->doc->extSubset == dtd) &&
1885 (dtd->doc->intSubset !=
NULL) &&
1886 (dtd->doc->intSubset->attributes !=
NULL)) {
1900 dtd->attributes = (
void *)
table;
1904 "xmlAddAttributeDecl: Table creation failed!\n");
1910 ret = (xmlAttributePtr)
xmlMalloc(
sizeof(xmlAttribute));
1917 ret->type = XML_ATTRIBUTE_DECL;
1928 ret->doc = dtd->doc;
1940 if (defaultValue !=
NULL) {
1952#ifdef LIBXML_VALID_ENABLED
1957 "Attribute %s of element %s: already defined\n",
1969 if (elemDef !=
NULL) {
1971#ifdef LIBXML_VALID_ENABLED
1972 if ((
type == XML_ATTRIBUTE_ID) &&
1973 (xmlScanIDAttributeDecl(
NULL, elemDef, 1) != 0)) {
1975 "Element %s has too may ID attributes defined : %s\n",
1989 ret->nexth = elemDef->attributes;
1990 elemDef->attributes =
ret;
1992 xmlAttributePtr tmp = elemDef->attributes;
1994 while ((tmp !=
NULL) &&
1998 if (tmp->nexth ==
NULL)
2003 ret->nexth = tmp->nexth;
2006 ret->nexth = elemDef->attributes;
2007 elemDef->attributes =
ret;
2016 if (dtd->last ==
NULL) {
2017 dtd->children = dtd->last = (xmlNodePtr)
ret;
2019 dtd->last->next = (xmlNodePtr)
ret;
2020 ret->prev = dtd->last;
2021 dtd->last = (xmlNodePtr)
ret;
2042#ifdef LIBXML_TREE_ENABLED
2053 xmlAttributePtr
attr = (xmlAttributePtr) payload;
2054 xmlAttributePtr
cur;
2056 cur = (xmlAttributePtr)
xmlMalloc(
sizeof(xmlAttribute));
2062 cur->type = XML_ATTRIBUTE_DECL;
2065 cur->tree = xmlCopyEnumeration(
attr->tree);
2091#ifdef LIBXML_OUTPUT_ENABLED
2101xmlDumpAttributeDecl(xmlBufferPtr
buf, xmlAttributePtr
attr) {
2104 xmlBufferWriteChar(
buf,
"<!ATTLIST ");
2105 xmlBufferWriteCHAR(
buf,
attr->elem);
2106 xmlBufferWriteChar(
buf,
" ");
2108 xmlBufferWriteCHAR(
buf,
attr->prefix);
2109 xmlBufferWriteChar(
buf,
":");
2112 switch (
attr->atype) {
2113 case XML_ATTRIBUTE_CDATA:
2114 xmlBufferWriteChar(
buf,
" CDATA");
2116 case XML_ATTRIBUTE_ID:
2117 xmlBufferWriteChar(
buf,
" ID");
2119 case XML_ATTRIBUTE_IDREF:
2120 xmlBufferWriteChar(
buf,
" IDREF");
2122 case XML_ATTRIBUTE_IDREFS:
2123 xmlBufferWriteChar(
buf,
" IDREFS");
2125 case XML_ATTRIBUTE_ENTITY:
2126 xmlBufferWriteChar(
buf,
" ENTITY");
2128 case XML_ATTRIBUTE_ENTITIES:
2129 xmlBufferWriteChar(
buf,
" ENTITIES");
2131 case XML_ATTRIBUTE_NMTOKEN:
2132 xmlBufferWriteChar(
buf,
" NMTOKEN");
2134 case XML_ATTRIBUTE_NMTOKENS:
2135 xmlBufferWriteChar(
buf,
" NMTOKENS");
2137 case XML_ATTRIBUTE_ENUMERATION:
2138 xmlBufferWriteChar(
buf,
" (");
2139 xmlDumpEnumeration(
buf,
attr->tree);
2141 case XML_ATTRIBUTE_NOTATION:
2142 xmlBufferWriteChar(
buf,
" NOTATION (");
2143 xmlDumpEnumeration(
buf,
attr->tree);
2147 "Internal: ATTRIBUTE struct corrupted invalid type\n",
2150 switch (
attr->def) {
2151 case XML_ATTRIBUTE_NONE:
2153 case XML_ATTRIBUTE_REQUIRED:
2154 xmlBufferWriteChar(
buf,
" #REQUIRED");
2156 case XML_ATTRIBUTE_IMPLIED:
2157 xmlBufferWriteChar(
buf,
" #IMPLIED");
2159 case XML_ATTRIBUTE_FIXED:
2160 xmlBufferWriteChar(
buf,
" #FIXED");
2164 "Internal: ATTRIBUTE struct corrupted invalid def\n",
2168 xmlBufferWriteChar(
buf,
" ");
2169 xmlBufferWriteQuotedString(
buf,
attr->defaultValue);
2171 xmlBufferWriteChar(
buf,
">\n");
2182xmlDumpAttributeDeclScan(
void *
attr,
void *
buf,
2184 xmlDumpAttributeDecl((xmlBufferPtr)
buf, (xmlAttributePtr)
attr);
2215 if (nota ==
NULL)
return;
2216 if (nota->name !=
NULL)
2218 if (nota->PublicID !=
NULL)
2220 if (nota->SystemID !=
NULL)
2251 if ((PublicID ==
NULL) && (SystemID ==
NULL)) {
2261 if (dtd->doc !=
NULL)
2262 dict = dtd->doc->dict;
2268 "xmlAddNotationDecl: Table creation failed!\n");
2283 if (SystemID !=
NULL)
2285 if (PublicID !=
NULL)
2293#ifdef LIBXML_VALID_ENABLED
2295 "xmlAddNotationDecl: %s already defined\n",
2296 (
const char *)
name);
2320#ifdef LIBXML_TREE_ENABLED
2331 xmlNotationPtr nota = (xmlNotationPtr) payload;
2339 if (nota->name !=
NULL)
2343 if (nota->PublicID !=
NULL)
2347 if (nota->SystemID !=
NULL)
2368#ifdef LIBXML_OUTPUT_ENABLED
2377xmlDumpNotationDecl(xmlBufferPtr
buf, xmlNotationPtr nota) {
2380 xmlBufferWriteChar(
buf,
"<!NOTATION ");
2381 xmlBufferWriteCHAR(
buf, nota->name);
2382 if (nota->PublicID !=
NULL) {
2383 xmlBufferWriteChar(
buf,
" PUBLIC ");
2384 xmlBufferWriteQuotedString(
buf, nota->PublicID);
2385 if (nota->SystemID !=
NULL) {
2386 xmlBufferWriteChar(
buf,
" ");
2387 xmlBufferWriteQuotedString(
buf, nota->SystemID);
2390 xmlBufferWriteChar(
buf,
" SYSTEM ");
2391 xmlBufferWriteQuotedString(
buf, nota->SystemID);
2393 xmlBufferWriteChar(
buf,
" >\n");
2404xmlDumpNotationDeclScan(
void *nota,
void *
buf,
2406 xmlDumpNotationDecl((xmlBufferPtr)
buf, (xmlNotationPtr) nota);
2436#define DICT_FREE(str) \
2437 if ((str) && ((!dict) || \
2438 (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \
2439 xmlFree((char *)(str));
2457 while (*
src == 0x20)
src++;
2460 while (*
src == 0x20)
src++;
2472 xmlParserCtxtPtr pctxt;
2478 pctxt = ctxt->userData;
2492 if (
id ==
NULL)
return;
2495 dict =
id->doc->dict;
2541 "xmlAddID: Table creation failed!\n");
2560 if (doc->dict !=
NULL)
2569 ret->lineno = xmlGetLineNo(
attr->parent);
2572#ifdef LIBXML_VALID_ENABLED
2585 attr->atype = XML_ATTRIBUTE_ID;
2625 if (doc ==
NULL)
return(0);
2626 if ((doc->intSubset ==
NULL) && (doc->extSubset ==
NULL) &&
2627 (doc->type != XML_HTML_DOCUMENT_NODE)) {
2629 }
else if (doc->type == XML_HTML_DOCUMENT_NODE) {
2638 xmlAttributePtr attrDecl =
NULL;
2641 xmlChar *fullelemname, *fullattrname;
2644 xmlBuildQName(
elem->name,
elem->ns->prefix, felem, 50) :
2651 if (fullelemname !=
NULL && fullattrname !=
NULL) {
2654 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
2659 if ((fullattrname !=
fattr) && (fullattrname !=
attr->
name))
2661 if ((fullelemname != felem) && (fullelemname !=
elem->name))
2664 if ((attrDecl !=
NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
2685 if (doc ==
NULL)
return(-1);
2692 ID = xmlNodeListGetString(doc,
attr->children, 1);
2743 return((xmlAttrPtr) doc);
2795 if (list_ref ==
NULL)
return;
2809 xmlAttrPtr attr0 = ((xmlRefPtr)
data)->attr;
2813 if (attr0 == attr1) {
2873 "xmlAddRef: Table creation failed!\n");
2897 ret->lineno = xmlGetLineNo(
attr->parent);
2909 "xmlAddRef: Reference list creation failed!\n",
2916 "xmlAddRef: Reference list insertion failed!\n",
2923 "xmlAddRef: Reference list insertion failed!\n",
2972 if (doc ==
NULL)
return(0);
2975 if ((doc->intSubset ==
NULL) && (doc->extSubset ==
NULL)) {
2977 }
else if (doc->type == XML_HTML_DOCUMENT_NODE) {
2981 xmlAttributePtr attrDecl;
2985 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
2989 if ((attrDecl !=
NULL) &&
2990 (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
2991 attrDecl->atype == XML_ATTRIBUTE_IDREFS))
3015 if (doc ==
NULL)
return(-1);
3022 ID = xmlNodeListGetString(doc,
attr->children, 1);
3027 if(ref_list ==
NULL) {
3108 if (dtd->elements ==
NULL)
3139 if (dtd->elements ==
NULL) {
3142 if (dtd->doc !=
NULL)
3143 dict = dtd->doc->dict;
3153 dtd->elements = (
void *)
table;
3173 cur->type = XML_ELEMENT_DECL;
3180 cur->etype = XML_ELEMENT_TYPE_UNDEFINED;
3211 if (dtd->elements ==
NULL)
return(
NULL);
3232 xmlAttributePtr
cur;
3236 if (dtd->attributes ==
NULL)
return(
NULL);
3244 if (uqname !=
NULL) {
3272 if (dtd->attributes ==
NULL)
return(
NULL);
3293 if (dtd->notations ==
NULL)
return(
NULL);
3299#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
3314 const xmlChar *notationName) {
3315 xmlNotationPtr notaDecl;
3316 if ((doc ==
NULL) || (doc->intSubset ==
NULL) ||
3317 (notationName ==
NULL))
return(-1);
3320 if ((notaDecl ==
NULL) && (doc->extSubset !=
NULL))
3323 if ((notaDecl ==
NULL) && (ctxt !=
NULL)) {
3325 "NOTATION %s is not declared\n",
3346 xmlElementPtr elemDecl;
3348 if ((doc ==
NULL) || (doc->intSubset ==
NULL))
return(-1);
3351 if ((elemDecl ==
NULL) && (doc->extSubset !=
NULL))
3353 if (elemDecl ==
NULL)
return(-1);
3354 switch (elemDecl->etype) {
3355 case XML_ELEMENT_TYPE_UNDEFINED:
3357 case XML_ELEMENT_TYPE_ELEMENT:
3359 case XML_ELEMENT_TYPE_EMPTY:
3364 case XML_ELEMENT_TYPE_ANY:
3365 case XML_ELEMENT_TYPE_MIXED:
3371#ifdef LIBXML_VALID_ENABLED
3374xmlIsDocNameStartChar(xmlDocPtr doc,
int c) {
3375 if ((doc ==
NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
3380 if (((
c >=
'a') && (
c <=
'z')) ||
3381 ((
c >=
'A') && (
c <=
'Z')) ||
3382 (
c ==
'_') || (
c ==
':') ||
3383 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3384 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3385 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3386 ((
c >= 0x370) && (
c <= 0x37D)) ||
3387 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3388 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3389 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3390 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3391 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3392 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3393 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3394 ((
c >= 0x10000) && (
c <= 0xEFFFF)))
3404xmlIsDocNameChar(xmlDocPtr doc,
int c) {
3405 if ((doc ==
NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
3410 if (((
c >=
'a') && (
c <=
'z')) ||
3411 ((
c >=
'A') && (
c <=
'Z')) ||
3412 ((
c >=
'0') && (
c <=
'9')) ||
3413 (
c ==
'_') || (
c ==
':') ||
3414 (
c ==
'-') || (
c ==
'.') || (
c == 0xB7) ||
3415 ((
c >= 0xC0) && (
c <= 0xD6)) ||
3416 ((
c >= 0xD8) && (
c <= 0xF6)) ||
3417 ((
c >= 0xF8) && (
c <= 0x2FF)) ||
3418 ((
c >= 0x300) && (
c <= 0x36F)) ||
3419 ((
c >= 0x370) && (
c <= 0x37D)) ||
3420 ((
c >= 0x37F) && (
c <= 0x1FFF)) ||
3421 ((
c >= 0x200C) && (
c <= 0x200D)) ||
3422 ((
c >= 0x203F) && (
c <= 0x2040)) ||
3423 ((
c >= 0x2070) && (
c <= 0x218F)) ||
3424 ((
c >= 0x2C00) && (
c <= 0x2FEF)) ||
3425 ((
c >= 0x3001) && (
c <= 0xD7FF)) ||
3426 ((
c >= 0xF900) && (
c <= 0xFDCF)) ||
3427 ((
c >= 0xFDF0) && (
c <= 0xFFFD)) ||
3428 ((
c >= 0x10000) && (
c <= 0xEFFFF)))
3432 (
c ==
'.') || (
c ==
'-') ||
3433 (
c ==
'_') || (
c ==
':') ||
3452xmlValidateNameValueInternal(xmlDocPtr doc,
const xmlChar *
value) {
3460 if (!xmlIsDocNameStartChar(doc,
val))
3465 while (xmlIsDocNameChar(doc,
val)) {
3470 if (
val != 0)
return(0);
3486 return(xmlValidateNameValueInternal(
NULL,
value));
3500xmlValidateNamesValueInternal(xmlDocPtr doc,
const xmlChar *
value) {
3509 if (!xmlIsDocNameStartChar(doc,
val))
3514 while (xmlIsDocNameChar(doc,
val)) {
3520 while (
val == 0x20) {
3521 while (
val == 0x20) {
3526 if (!xmlIsDocNameStartChar(doc,
val))
3532 while (xmlIsDocNameChar(doc,
val)) {
3538 if (
val != 0)
return(0);
3554 return(xmlValidateNamesValueInternal(
NULL,
value));
3570xmlValidateNmtokenValueInternal(xmlDocPtr doc,
const xmlChar *
value) {
3579 if (!xmlIsDocNameChar(doc,
val))
3584 while (xmlIsDocNameChar(doc,
val)) {
3589 if (
val != 0)
return(0);
3607 return(xmlValidateNmtokenValueInternal(
NULL,
value));
3623xmlValidateNmtokensValueInternal(xmlDocPtr doc,
const xmlChar *
value) {
3637 if (!xmlIsDocNameChar(doc,
val))
3640 while (xmlIsDocNameChar(doc,
val)) {
3646 while (
val == 0x20) {
3647 while (
val == 0x20) {
3651 if (
val == 0)
return(1);
3653 if (!xmlIsDocNameChar(doc,
val))
3659 while (xmlIsDocNameChar(doc,
val)) {
3665 if (
val != 0)
return(0);
3683 return(xmlValidateNmtokensValueInternal(
NULL,
value));
3721xmlValidateAttributeValueInternal(xmlDocPtr doc, xmlAttributeType
type,
3724 case XML_ATTRIBUTE_ENTITIES:
3725 case XML_ATTRIBUTE_IDREFS:
3726 return(xmlValidateNamesValueInternal(doc,
value));
3727 case XML_ATTRIBUTE_ENTITY:
3728 case XML_ATTRIBUTE_IDREF:
3729 case XML_ATTRIBUTE_ID:
3730 case XML_ATTRIBUTE_NOTATION:
3731 return(xmlValidateNameValueInternal(doc,
value));
3732 case XML_ATTRIBUTE_NMTOKENS:
3733 case XML_ATTRIBUTE_ENUMERATION:
3734 return(xmlValidateNmtokensValueInternal(doc,
value));
3735 case XML_ATTRIBUTE_NMTOKEN:
3736 return(xmlValidateNmtokenValueInternal(doc,
value));
3737 case XML_ATTRIBUTE_CDATA:
3769 return(xmlValidateAttributeValueInternal(
NULL,
type,
value));
3806 case XML_ATTRIBUTE_IDREFS:
3807 case XML_ATTRIBUTE_IDREF:
3808 case XML_ATTRIBUTE_ID:
3809 case XML_ATTRIBUTE_NMTOKENS:
3810 case XML_ATTRIBUTE_ENUMERATION:
3811 case XML_ATTRIBUTE_NMTOKEN:
3812 case XML_ATTRIBUTE_CDATA:
3814 case XML_ATTRIBUTE_ENTITY: {
3819 if ((ent ==
NULL) && (doc->standalone == 1)) {
3820 doc->standalone = 0;
3824 xmlErrValidNode(ctxt, (xmlNodePtr) doc,
3826 "ENTITY attribute %s reference an unknown entity \"%s\"\n",
3830 xmlErrValidNode(ctxt, (xmlNodePtr) doc,
3832 "ENTITY attribute %s reference an entity \"%s\" of wrong type\n",
3838 case XML_ATTRIBUTE_ENTITIES: {
3853 xmlErrValidNode(ctxt, (xmlNodePtr) doc,
3855 "ENTITIES attribute %s reference an unknown entity \"%s\"\n",
3859 xmlErrValidNode(ctxt, (xmlNodePtr) doc,
3861 "ENTITIES attribute %s reference an entity \"%s\" of wrong type\n",
3873 case XML_ATTRIBUTE_NOTATION: {
3874 xmlNotationPtr nota;
3877 if ((nota ==
NULL) && (doc->extSubset !=
NULL))
3881 xmlErrValidNode(ctxt, (xmlNodePtr) doc,
3883 "NOTATION attribute %s reference an unknown notation \"%s\"\n",
3918xmlValidCtxtNormalizeAttributeValue(
xmlValidCtxtPtr ctxt, xmlDocPtr doc,
3921 xmlAttributePtr attrDecl =
NULL;
3937 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL)) {
3939 if (attrDecl !=
NULL)
3945 if ((attrDecl ==
NULL) && (doc->intSubset !=
NULL))
3947 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL)) {
3949 if (attrDecl !=
NULL)
3953 if (attrDecl ==
NULL)
3955 if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
3964"standalone: %s on %s value had to be normalized based on external subset declaration\n",
3991xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr
elem,
3994 xmlAttributePtr attrDecl =
NULL;
4012 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4015 if (attrDecl ==
NULL)
4017 if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
4028xmlValidateAttributeIdCallback(
void *payload,
void *
data,
4030 xmlAttributePtr
attr = (xmlAttributePtr) payload;
4032 if (
attr->atype == XML_ATTRIBUTE_ID) (*count)++;
4055 xmlAttributePtr
attr) {
4064 val = xmlValidateAttributeValueInternal(doc,
attr->atype,
4065 attr->defaultValue);
4068 "Syntax of default value for attribute %s of %s is not valid\n",
4075 if ((
attr->atype == XML_ATTRIBUTE_ID)&&
4076 (
attr->def != XML_ATTRIBUTE_IMPLIED) &&
4077 (
attr->def != XML_ATTRIBUTE_REQUIRED)) {
4079 "ID attribute %s of %s is not valid must be #IMPLIED or #REQUIRED\n",
4085 if (
attr->atype == XML_ATTRIBUTE_ID) {
4092 nbId = xmlScanIDAttributeDecl(
NULL,
elem, 0);
4101 if (doc->intSubset !=
NULL) {
4104 xmlValidateAttributeIdCallback, &nbId);
4110 "Element %s has %d ID attribute defined in the internal subset : %s\n",
4112 }
else if (doc->extSubset !=
NULL) {
4116 extId = xmlScanIDAttributeDecl(
NULL,
elem, 0);
4120 "Element %s has %d ID attribute defined in the external subset : %s\n",
4122 }
else if (extId + nbId > 1) {
4124"Element %s has ID attributes defined in the internal and external subset : %s\n",
4132 xmlEnumerationPtr
tree =
attr->tree;
4139"Default value \"%s\" for attribute %s of %s is not among the enumerated set\n",
4166 xmlElementPtr
elem) {
4175#ifdef LIBXML_REGEXP_ENABLED
4177 ret = xmlValidBuildContentModel(ctxt,
elem);
4182 if (
elem->etype == XML_ELEMENT_TYPE_MIXED) {
4183 xmlElementContentPtr
cur,
next;
4188 if (
cur->type != XML_ELEMENT_CONTENT_OR)
break;
4190 if (
cur->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
4194 if (
next->type == XML_ELEMENT_CONTENT_ELEMENT) {
4197 if (
cur->c1->prefix ==
NULL) {
4199 "Definition of %s has duplicate references of %s\n",
4203 "Definition of %s has duplicate references of %s:%s\n",
4211 if (
next->c1->type != XML_ELEMENT_CONTENT_ELEMENT)
break;
4214 if (
cur->c1->prefix ==
NULL) {
4216 "Definition of %s has duplicate references to %s\n",
4220 "Definition of %s has duplicate references to %s:%s\n",
4234 if ((tst !=
NULL ) && (tst !=
elem) &&
4235 ((tst->prefix ==
elem->prefix) ||
4237 (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
4239 "Redefinition of element %s\n",
4244 if ((tst !=
NULL ) && (tst !=
elem) &&
4245 ((tst->prefix ==
elem->prefix) ||
4247 (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
4249 "Redefinition of element %s\n",
4290 xmlAttributePtr attrDecl =
NULL;
4308 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4313 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4320 if (attrDecl ==
NULL) {
4324 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4330 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4338 if (attrDecl ==
NULL) {
4340 "No declaration for attribute %s of element %s\n",
4344 attr->atype = attrDecl->atype;
4346 val = xmlValidateAttributeValueInternal(doc, attrDecl->atype,
value);
4349 "Syntax of value for attribute %s of %s is not valid\n",
4355 if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
4358 "Value for attribute %s of %s is different from default \"%s\"\n",
4365 if (attrDecl->atype == XML_ATTRIBUTE_ID) {
4370 if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
4371 (attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
4377 if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
4378 xmlEnumerationPtr
tree = attrDecl->tree;
4379 xmlNotationPtr nota;
4388 "Value \"%s\" for attribute %s of %s is not a declared Notation\n",
4400"Value \"%s\" for attribute %s of %s is not among the enumerated notations\n",
4407 if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
4408 xmlEnumerationPtr
tree = attrDecl->tree;
4415 "Value \"%s\" for attribute %s of %s is not among the enumerated set\n",
4422 if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
4425 "Value for attribute %s of %s must be \"%s\"\n",
4431 ret &= xmlValidateAttributeValue2(ctxt, doc,
attr->
name,
4432 attrDecl->atype,
value);
4467 xmlAttributePtr attrDecl =
NULL;
4487 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4493 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4500 if (attrDecl ==
NULL) {
4504 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4510 if ((attrDecl ==
NULL) && (doc->extSubset !=
NULL))
4518 if (attrDecl ==
NULL) {
4521 "No declaration for attribute xmlns:%s of element %s\n",
4525 "No declaration for attribute xmlns of element %s\n",
4531 val = xmlValidateAttributeValueInternal(doc, attrDecl->atype,
value);
4535 "Syntax of value for attribute xmlns:%s of %s is not valid\n",
4539 "Syntax of value for attribute xmlns of %s is not valid\n",
4546 if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
4550 "Value for attribute xmlns:%s of %s is different from default \"%s\"\n",
4554 "Value for attribute xmlns of %s is different from default \"%s\"\n",
4555 elem->name, attrDecl->defaultValue,
NULL);
4568 if (attrDecl->atype == XML_ATTRIBUTE_ID) {
4573 if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
4574 (attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
4581 if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
4582 xmlEnumerationPtr
tree = attrDecl->tree;
4583 xmlNotationPtr nota;
4593 "Value \"%s\" for attribute xmlns:%s of %s is not a declared Notation\n",
4597 "Value \"%s\" for attribute xmlns of %s is not a declared Notation\n",
4611"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated notations\n",
4615"Value \"%s\" for attribute xmlns of %s is not among the enumerated notations\n",
4623 if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
4624 xmlEnumerationPtr
tree = attrDecl->tree;
4632"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated set\n",
4636"Value \"%s\" for attribute xmlns of %s is not among the enumerated set\n",
4644 if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
4648 "Value for attribute xmlns:%s of %s must be \"%s\"\n",
4652 "Value for attribute xmlns of %s must be \"%s\"\n",
4653 elem->name, attrDecl->defaultValue,
NULL);
4660 ret &= xmlValidateAttributeValue2(ctxt, doc,
ns->
prefix,
4661 attrDecl->atype,
value);
4663 ret &= xmlValidateAttributeValue2(ctxt, doc,
BAD_CAST "xmlns",
4664 attrDecl->atype,
value);
4670#ifndef LIBXML_REGEXP_ENABLED
4682xmlValidateSkipIgnorable(xmlNodePtr
child) {
4684 switch (
child->type) {
4687 case XML_COMMENT_NODE:
4688 case XML_XINCLUDE_START:
4689 case XML_XINCLUDE_END:
4693 if (xmlIsBlankNode(
child))
4720 int determinist = 1;
4722 NODE = xmlValidateSkipIgnorable(
NODE);
4726 ((CONT->ocur == XML_ELEMENT_CONTENT_MULT) ||
4727 (CONT->ocur == XML_ELEMENT_CONTENT_OPT))) {
4730 if (CONT ==
NULL)
return(-1);
4731 if ((
NODE !=
NULL) && (
NODE->type == XML_ENTITY_REF_NODE))
4743 if (
STATE == ROLLBACK_PARENT) {
4752 if ((CONT !=
NULL) &&
4753 ((CONT->parent ==
NULL) ||
4754 (CONT->parent == (xmlElementContentPtr) 1) ||
4755 (CONT->parent->type != XML_ELEMENT_CONTENT_OR)) &&
4756 ((CONT->ocur == XML_ELEMENT_CONTENT_MULT) ||
4757 (CONT->ocur == XML_ELEMENT_CONTENT_OPT) ||
4758 ((CONT->ocur == XML_ELEMENT_CONTENT_PLUS) && (OCCURRENCE)))) {
4759 if (vstateVPush(ctxt, CONT,
NODE, DEPTH, OCCURS, ROLLBACK_PARENT) < 0)
4767 switch (CONT->type) {
4768 case XML_ELEMENT_CONTENT_PCDATA:
4773 if (
NODE->type == XML_TEXT_NODE) {
4780 NODE = xmlValidateSkipIgnorable(
NODE);
4782 (
NODE->type == XML_ENTITY_REF_NODE))
4785 ((
NODE->type != XML_ELEMENT_NODE) &&
4786 (
NODE->type != XML_TEXT_NODE) &&
4787 (
NODE->type != XML_CDATA_SECTION_NODE)));
4795 case XML_ELEMENT_CONTENT_ELEMENT:
4800 ret = ((
NODE->type == XML_ELEMENT_NODE) &&
4805 }
else if (CONT->prefix ==
NULL) {
4818 NODE = xmlValidateSkipIgnorable(
NODE);
4820 (
NODE->type == XML_ENTITY_REF_NODE))
4823 ((
NODE->type != XML_ELEMENT_NODE) &&
4824 (
NODE->type != XML_TEXT_NODE) &&
4825 (
NODE->type != XML_CDATA_SECTION_NODE)));
4831 case XML_ELEMENT_CONTENT_OR:
4835 if (CONT->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
4843 ret = (CONT->c1->prefix ==
NULL);
4844 }
else if (CONT->c1->prefix ==
NULL) {
4859 if (vstateVPush(ctxt, CONT->c2,
NODE, DEPTH + 1,
4860 OCCURS, ROLLBACK_OR) < 0)
4865 case XML_ELEMENT_CONTENT_SEQ:
4869 if ((CONT->c1->type == XML_ELEMENT_CONTENT_ELEMENT) &&
4870 ((CONT->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
4871 (CONT->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
4879 ret = (CONT->c1->prefix ==
NULL);
4880 }
else if (CONT->c1->prefix ==
NULL) {
4903 while (CONT !=
NULL) {
4909 switch (CONT->ocur) {
4912 case XML_ELEMENT_CONTENT_ONCE:
4913 cur = ctxt->vstate->node;
4914 if (vstateVPop(ctxt) < 0 ) {
4917 if (
cur != ctxt->vstate->node)
4920 case XML_ELEMENT_CONTENT_PLUS:
4921 if (OCCURRENCE == 0) {
4922 cur = ctxt->vstate->node;
4923 if (vstateVPop(ctxt) < 0 ) {
4926 if (
cur != ctxt->vstate->node)
4932 case XML_ELEMENT_CONTENT_MULT:
4935 case XML_ELEMENT_CONTENT_OPT:
4940 switch (CONT->ocur) {
4941 case XML_ELEMENT_CONTENT_OPT:
4944 case XML_ELEMENT_CONTENT_ONCE:
4947 case XML_ELEMENT_CONTENT_PLUS:
4948 if (
STATE == ROLLBACK_PARENT) {
4958 case XML_ELEMENT_CONTENT_MULT:
4959 if (
STATE == ROLLBACK_PARENT) {
4977 if ((CONT->parent ==
NULL) ||
4978 (CONT->parent == (xmlElementContentPtr) 1))
4981 switch (CONT->parent->type) {
4982 case XML_ELEMENT_CONTENT_PCDATA:
4984 case XML_ELEMENT_CONTENT_ELEMENT:
4986 case XML_ELEMENT_CONTENT_OR:
4988 CONT = CONT->parent;
4991 CONT = CONT->parent;
4995 case XML_ELEMENT_CONTENT_SEQ:
4997 CONT = CONT->parent;
4999 }
else if (CONT == CONT->parent->c1) {
5000 CONT = CONT->parent->c2;
5003 CONT = CONT->parent;
5011 cur = ctxt->vstate->node;
5012 if (vstateVPop(ctxt) < 0 ) {
5015 if (
cur != ctxt->vstate->node)
5022 cur = ctxt->vstate->node;
5023 if (vstateVPop(ctxt) < 0 ) {
5026 if (
cur != ctxt->vstate->node)
5030 return(determinist);
5059 switch (
cur->type) {
5060 case XML_ELEMENT_NODE:
5080 if (xmlIsBlankNode(
cur))
5083 case XML_CDATA_SECTION_NODE:
5084 case XML_ENTITY_REF_NODE:
5089 case XML_ATTRIBUTE_NODE:
5090 case XML_DOCUMENT_NODE:
5091 case XML_HTML_DOCUMENT_NODE:
5092 case XML_DOCUMENT_TYPE_NODE:
5093 case XML_DOCUMENT_FRAG_NODE:
5094 case XML_NOTATION_NODE:
5095 case XML_NAMESPACE_DECL:
5100 case XML_ENTITY_NODE:
5103 case XML_COMMENT_NODE:
5104 case XML_ELEMENT_DECL:
5105 case XML_ATTRIBUTE_DECL:
5106 case XML_ENTITY_DECL:
5107 case XML_XINCLUDE_START:
5108 case XML_XINCLUDE_END:
5131 xmlElementPtr elemDecl,
int warn, xmlNodePtr
parent) {
5133#ifndef LIBXML_REGEXP_ENABLED
5137 xmlElementContentPtr cont;
5142 cont = elemDecl->content;
5145#ifdef LIBXML_REGEXP_ENABLED
5147 if (elemDecl->contModel ==
NULL)
5148 ret = xmlValidBuildContentModel(ctxt, elemDecl);
5149 if (elemDecl->contModel ==
NULL) {
5152 xmlRegExecCtxtPtr exec;
5154 if (!xmlRegexpIsDeterminist(elemDecl->contModel)) {
5159 ctxt->nodeTab =
NULL;
5160 exec = xmlRegNewExecCtxt(elemDecl->contModel,
NULL,
NULL);
5164 switch (
cur->type) {
5165 case XML_ENTITY_REF_NODE:
5170 if ((
cur->children !=
NULL) &&
5171 (
cur->children->children !=
NULL)) {
5172 nodeVPush(ctxt,
cur);
5173 cur =
cur->children->children;
5178 if (xmlIsBlankNode(
cur))
5182 case XML_CDATA_SECTION_NODE:
5186 case XML_ELEMENT_NODE:
5192 cur->ns->prefix,
fn, 50);
5201 ret = xmlRegExecPushString(exec,
cur->name,
NULL);
5212 cur = nodeVPop(ctxt);
5220 xmlRegFreeExecCtxt(exec);
5227 ctxt->vstateMax = 8;
5229 ctxt->vstateMax *
sizeof(ctxt->vstateTab[0]));
5230 if (ctxt->vstateTab ==
NULL) {
5239 ctxt->nodeTab =
NULL;
5240 ctxt->vstate = &ctxt->vstateTab[0];
5247 ret = xmlValidateElementType(ctxt);
5252 xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
5254 "Content model of %s is not deterministic: %s\n",
5256 }
else if (
ret == -2) {
5264 switch (
cur->type) {
5265 case XML_ENTITY_REF_NODE:
5270 if ((
cur->children !=
NULL) &&
5271 (
cur->children->children !=
NULL)) {
5272 nodeVPush(ctxt,
cur);
5273 cur =
cur->children->children;
5278 if (xmlIsBlankNode(
cur))
5281 case XML_CDATA_SECTION_NODE:
5283 case XML_ELEMENT_NODE:
5288 tmp = (xmlNodePtr)
xmlMalloc(
sizeof(xmlNode));
5291 xmlFreeNodeList(repl);
5295 tmp->type =
cur->type;
5296 tmp->name =
cur->name;
5299 tmp->content =
NULL;
5306 if (
cur->type == XML_CDATA_SECTION_NODE) {
5322 cur = nodeVPop(ctxt);
5332 ctxt->vstate = &ctxt->vstateTab[0];
5339 ret = xmlValidateElementType(ctxt);
5350#ifndef LIBXML_REGEXP_ENABLED
5352 xmlSnprintfElements(&
list[0], 5000, repl, 1);
5355 xmlSnprintfElements(&
list[0], 5000,
child, 1);
5359 "Element %s content does not follow the DTD, expecting %s, got %s\n",
5363 "Element content does not follow the DTD, expecting %s, got %s\n",
5369 "Element %s content does not follow the DTD\n",
5373 "Element content does not follow the DTD\n",
5382#ifndef LIBXML_REGEXP_ENABLED
5387 while (repl !=
NULL) {
5392 ctxt->vstateMax = 0;
5393 if (ctxt->vstateTab !=
NULL) {
5395 ctxt->vstateTab =
NULL;
5400 if (ctxt->nodeTab !=
NULL) {
5402 ctxt->nodeTab =
NULL;
5425 (
elem->type != XML_ELEMENT_NODE))
5432 switch (
cur->type) {
5433 case XML_ENTITY_REF_NODE:
5438 if ((
cur->children !=
NULL) &&
5439 (
cur->children->children !=
NULL)) {
5440 nodeVPush(ctxt,
cur);
5441 cur =
cur->children->children;
5445 case XML_COMMENT_NODE:
5448 case XML_CDATA_SECTION_NODE:
5459 cur = nodeVPop(ctxt);
5468 if (ctxt->nodeTab !=
NULL) {
5470 ctxt->nodeTab =
NULL;
5475#ifdef LIBXML_REGEXP_ENABLED
5488 xmlElementContentPtr cont,
const xmlChar *qname) {
5491 name = xmlSplitQName3(qname, &plen);
5494 while (cont !=
NULL) {
5495 if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
5498 }
else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
5499 (cont->c1 !=
NULL) &&
5500 (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
5501 if ((cont->c1->prefix ==
NULL) &&
5504 }
else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
5505 (cont->c1 ==
NULL) ||
5506 (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
5508 "Internal: MIXED struct corrupted\n",
5515 while (cont !=
NULL) {
5516 if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
5517 if ((cont->prefix !=
NULL) &&
5518 (
xmlStrncmp(cont->prefix, qname, plen) == 0) &&
5521 }
else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
5522 (cont->c1 !=
NULL) &&
5523 (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
5524 if ((cont->c1->prefix !=
NULL) &&
5525 (
xmlStrncmp(cont->c1->prefix, qname, plen) == 0) &&
5528 }
else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
5529 (cont->c1 ==
NULL) ||
5530 (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
5532 "Internal: MIXED struct corrupted\n",
5557 xmlNodePtr
elem,
int *extsubset) {
5558 xmlElementPtr elemDecl =
NULL;
5561 if ((ctxt ==
NULL) || (doc ==
NULL) ||
5564 if (extsubset !=
NULL)
5576 if ((elemDecl ==
NULL) && (doc->extSubset !=
NULL)) {
5579 if ((elemDecl !=
NULL) && (extsubset !=
NULL))
5589 if (elemDecl ==
NULL) {
5591 if ((elemDecl ==
NULL) && (doc->extSubset !=
NULL)) {
5593 if ((elemDecl !=
NULL) && (extsubset !=
NULL))
5597 if (elemDecl ==
NULL) {
5598 xmlErrValidNode(ctxt,
elem,
5600 "No declaration for element %s\n",
5606#ifdef LIBXML_REGEXP_ENABLED
5622 xmlElementPtr eDecl;
5628 if ((ctxt->vstateNr > 0) && (ctxt->vstate !=
NULL)) {
5630 xmlElementPtr elemDecl;
5636 elemDecl =
state->elemDecl;
5638 switch(elemDecl->etype) {
5639 case XML_ELEMENT_TYPE_UNDEFINED:
5642 case XML_ELEMENT_TYPE_EMPTY:
5643 xmlErrValidNode(ctxt,
state->node,
5645 "Element %s was declared EMPTY this one has content\n",
5649 case XML_ELEMENT_TYPE_ANY:
5652 case XML_ELEMENT_TYPE_MIXED:
5654 if ((elemDecl->content !=
NULL) &&
5655 (elemDecl->content->type ==
5656 XML_ELEMENT_CONTENT_PCDATA)) {
5657 xmlErrValidNode(ctxt,
state->node,
5659 "Element %s was declared #PCDATA but contains non text nodes\n",
5663 ret = xmlValidateCheckMixed(ctxt, elemDecl->content,
5666 xmlErrValidNode(ctxt,
state->node,
5668 "Element %s is not declared in %s list of possible children\n",
5673 case XML_ELEMENT_TYPE_ELEMENT:
5683 xmlErrValidNode(ctxt,
state->node,
5685 "Element %s content does not follow the DTD, Misplaced %s\n",
5696 eDecl = xmlValidGetElemDecl(ctxt, doc,
elem, &extsubset);
5697 vstateVPush(ctxt, eDecl,
elem);
5720 if ((ctxt->vstateNr > 0) && (ctxt->vstate !=
NULL)) {
5722 xmlElementPtr elemDecl;
5728 elemDecl =
state->elemDecl;
5730 switch(elemDecl->etype) {
5731 case XML_ELEMENT_TYPE_UNDEFINED:
5734 case XML_ELEMENT_TYPE_EMPTY:
5735 xmlErrValidNode(ctxt,
state->node,
5737 "Element %s was declared EMPTY this one has content\n",
5741 case XML_ELEMENT_TYPE_ANY:
5743 case XML_ELEMENT_TYPE_MIXED:
5745 case XML_ELEMENT_TYPE_ELEMENT: {
5748 for (
i = 0;
i <
len;
i++) {
5750 xmlErrValidNode(ctxt,
state->node,
5752 "Element %s content does not follow the DTD, Text not allowed\n",
5793 if ((ctxt->vstateNr > 0) && (ctxt->vstate !=
NULL)) {
5795 xmlElementPtr elemDecl;
5801 elemDecl =
state->elemDecl;
5803 if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
5807 xmlErrValidNode(ctxt,
state->node,
5809 "Element %s content does not follow the DTD, Expecting more children\n",
5849 xmlElementPtr elemDecl =
NULL;
5850 xmlElementContentPtr cont;
5851 xmlAttributePtr
attr;
5860 switch (
elem->type) {
5861 case XML_ATTRIBUTE_NODE:
5868 "Text element has children !\n",
5874 "Text element has namespace !\n",
5880 "Text element has no content !\n",
5885 case XML_XINCLUDE_START:
5886 case XML_XINCLUDE_END:
5888 case XML_CDATA_SECTION_NODE:
5889 case XML_ENTITY_REF_NODE:
5891 case XML_COMMENT_NODE:
5893 case XML_ENTITY_NODE:
5897 case XML_NOTATION_NODE:
5901 case XML_DOCUMENT_NODE:
5902 case XML_DOCUMENT_TYPE_NODE:
5903 case XML_DOCUMENT_FRAG_NODE:
5907 case XML_HTML_DOCUMENT_NODE:
5911 case XML_ELEMENT_NODE:
5922 elemDecl = xmlValidGetElemDecl(ctxt, doc,
elem, &extsubset);
5923 if (elemDecl ==
NULL)
5930 if (ctxt->vstateNr == 0) {
5932 switch (elemDecl->etype) {
5933 case XML_ELEMENT_TYPE_UNDEFINED:
5935 "No declaration for element %s\n",
5938 case XML_ELEMENT_TYPE_EMPTY:
5941 "Element %s was declared EMPTY this one has content\n",
5946 case XML_ELEMENT_TYPE_ANY:
5949 case XML_ELEMENT_TYPE_MIXED:
5952 if ((elemDecl->content !=
NULL) &&
5953 (elemDecl->content->type == XML_ELEMENT_CONTENT_PCDATA)) {
5954 ret = xmlValidateOneCdataElement(ctxt, doc,
elem);
5957 "Element %s was declared #PCDATA but contains non text nodes\n",
5965 if (
child->type == XML_ELEMENT_NODE) {
5975 cont = elemDecl->content;
5976 while (cont !=
NULL) {
5977 if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
5980 }
else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
5981 (cont->c1 !=
NULL) &&
5982 (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
5985 }
else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
5986 (cont->c1 ==
NULL) ||
5987 (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
5989 "Internal: MIXED struct corrupted\n",
6000 cont = elemDecl->content;
6001 while (cont !=
NULL) {
6002 if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
6004 }
else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
6005 (cont->c1 !=
NULL) &&
6006 (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) {
6008 }
else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
6009 (cont->c1 ==
NULL) ||
6010 (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) {
6012 "Internal: MIXED struct corrupted\n",
6020 "Element %s is not declared in %s list of possible children\n",
6029 case XML_ELEMENT_TYPE_ELEMENT:
6030 if ((doc->standalone == 1) && (extsubset == 1)) {
6038 if (
child->type == XML_TEXT_NODE) {
6044 xmlErrValidNode(ctxt,
elem,
6046"standalone: %s declared in the external subset contains white spaces nodes\n",
6056 cont = elemDecl->content;
6057 tmp = xmlValidateElementContent(ctxt,
child, elemDecl, 1,
elem);
6065 attr = elemDecl->attributes;
6067 if (
attr->def == XML_ATTRIBUTE_REQUIRED) {
6092 attrib =
elem->properties;
6093 while (attrib !=
NULL) {
6096 xmlNsPtr nameSpace = attrib->ns;
6098 if (nameSpace ==
NULL)
6099 nameSpace =
elem->ns;
6105 if (nameSpace ==
NULL) {
6124 attrib = attrib->next;
6127 if (qualified == -1) {
6130 "Element %s does not carry attribute %s\n",
6135 "Element %s does not carry attribute %s:%s\n",
6139 }
else if (qualified == 0) {
6141 "Element %s required attribute %s:%s has no prefix\n",
6143 }
else if (qualified == 1) {
6145 "Element %s required attribute %s:%s has different prefix\n",
6148 }
else if (
attr->def == XML_ATTRIBUTE_FIXED) {
6162 xmlErrValidNode(ctxt,
elem,
6164 "Element %s namespace name for default namespace does not match the DTD\n",
6180 "Element %s namespace name for %s does not match the DTD\n",
6215 if (doc ==
NULL)
return(0);
6217 root = xmlDocGetRootElement(doc);
6220 "no root element\n",
NULL);
6228 if ((doc->intSubset !=
NULL) &&
6229 (doc->intSubset->name !=
NULL)) {
6253 "root and DTD name do not match '%s' and '%s'\n",
6254 root->name, doc->intSubset->name,
NULL);
6288 ret &= xmlValidateOneElement(ctxt, doc,
elem);
6290 if (
elem->type == XML_ELEMENT_NODE) {
6293 value = xmlNodeListGetString(doc,
attr->children, 0);
6303 ret &= xmlValidateOneNamespace(ctxt, doc,
elem,
NULL,
6306 ret &= xmlValidateOneNamespace(ctxt, doc,
elem,
6367 "attribute %s line %d references an unknown ID \"%s\"\n",
6377 }
else if (
attr->atype == XML_ATTRIBUTE_IDREF) {
6381 "IDREF attribute %s references an unknown ID \"%s\"\n",
6385 }
else if (
attr->atype == XML_ATTRIBUTE_IDREFS) {
6403 "IDREFS attribute %s references an unknown ID \"%s\"\n",
6424xmlWalkValidateList(
const void *
data,
void *
user)
6427 xmlValidateRef((xmlRefPtr)
data, memo->
ctxt, memo->
name);
6439xmlValidateCheckRefCallback(
void *payload,
void *
data,
const xmlChar *
name) {
6444 if (ref_list ==
NULL)
6449 xmlListWalk(ref_list, xmlWalkValidateList, &memo);
6477 "xmlValidateDocumentFinal: doc == NULL\n",
NULL);
6483 ctxt->flags &= ~XML_VCTXT_USE_PCTXT;
6500 return(ctxt->valid);
6522 xmlDtdPtr oldExt, oldInt;
6525 if (dtd ==
NULL)
return(0);
6526 if (doc ==
NULL)
return(0);
6527 oldExt = doc->extSubset;
6528 oldInt = doc->intSubset;
6529 doc->extSubset = dtd;
6530 doc->intSubset =
NULL;
6531 ret = xmlValidateRoot(ctxt, doc);
6533 doc->extSubset = oldExt;
6534 doc->intSubset = oldInt;
6537 if (doc->ids !=
NULL) {
6541 if (doc->refs !=
NULL) {
6545 root = xmlDocGetRootElement(doc);
6546 ret = xmlValidateElement(ctxt, doc,
root);
6547 ret &= xmlValidateDocumentFinal(ctxt, doc);
6548 doc->extSubset = oldExt;
6549 doc->intSubset = oldInt;
6554xmlValidateNotationCallback(
void *payload,
void *
data,
6556 xmlEntityPtr
cur = (xmlEntityPtr) payload;
6563 if (notation !=
NULL) {
6566 ret = xmlValidateNotationUse(ctxt,
cur->doc, notation);
6575xmlValidateAttributeCallback(
void *payload,
void *
data,
6577 xmlAttributePtr
cur = (xmlAttributePtr) payload;
6585 switch (
cur->atype) {
6586 case XML_ATTRIBUTE_CDATA:
6587 case XML_ATTRIBUTE_ID:
6588 case XML_ATTRIBUTE_IDREF :
6589 case XML_ATTRIBUTE_IDREFS:
6590 case XML_ATTRIBUTE_NMTOKEN:
6591 case XML_ATTRIBUTE_NMTOKENS:
6592 case XML_ATTRIBUTE_ENUMERATION:
6594 case XML_ATTRIBUTE_ENTITY:
6595 case XML_ATTRIBUTE_ENTITIES:
6596 case XML_ATTRIBUTE_NOTATION:
6597 if (
cur->defaultValue !=
NULL) {
6599 ret = xmlValidateAttributeValue2(ctxt, ctxt->doc,
cur->name,
6600 cur->atype,
cur->defaultValue);
6601 if ((
ret == 0) && (ctxt->valid == 1))
6605 xmlEnumerationPtr
tree =
cur->tree;
6607 ret = xmlValidateAttributeValue2(ctxt, ctxt->doc,
6609 if ((
ret == 0) && (ctxt->valid == 1))
6615 if (
cur->atype == XML_ATTRIBUTE_NOTATION) {
6619 "xmlValidateAttributeCallback(%s): internal error\n",
6620 (
const char *)
cur->name);
6629 (
cur->parent->type == XML_DTD_NODE))
6633 "attribute %s: could not find decl for element %s\n",
6637 if (
elem->etype == XML_ELEMENT_TYPE_EMPTY) {
6639 "NOTATION attribute %s declared for EMPTY element %s\n",
6669 if ((doc ==
NULL) || (ctxt ==
NULL))
return(0);
6670 if ((doc->intSubset ==
NULL) && (doc->extSubset ==
NULL))
6674 dtd = doc->intSubset;
6675 if ((dtd !=
NULL) && (dtd->attributes !=
NULL)) {
6679 if ((dtd !=
NULL) && (dtd->entities !=
NULL)) {
6681 xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
6683 dtd = doc->extSubset;
6684 if ((dtd !=
NULL) && (dtd->attributes !=
NULL)) {
6688 if ((dtd !=
NULL) && (dtd->entities !=
NULL)) {
6690 xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
6692 return(ctxt->valid);
6716 if ((doc->intSubset ==
NULL) && (doc->extSubset ==
NULL)) {
6718 "no DTD found!\n",
NULL);
6721 if ((doc->intSubset !=
NULL) && ((doc->intSubset->SystemID !=
NULL) ||
6722 (doc->intSubset->ExternalID !=
NULL)) && (doc->extSubset ==
NULL)) {
6724 if (doc->intSubset->SystemID !=
NULL) {
6727 if (sysID ==
NULL) {
6729 "Could not build URI for external subset \"%s\"\n",
6730 (
const char *) doc->intSubset->SystemID);
6735 doc->extSubset = xmlParseDTD(doc->intSubset->ExternalID,
6739 if (doc->extSubset ==
NULL) {
6740 if (doc->intSubset->SystemID !=
NULL) {
6742 "Could not load the external subset \"%s\"\n",
6743 (
const char *) doc->intSubset->SystemID);
6746 "Could not load the external subset \"%s\"\n",
6747 (
const char *) doc->intSubset->ExternalID);
6753 if (doc->ids !=
NULL) {
6757 if (doc->refs !=
NULL) {
6761 ret = xmlValidateDtdFinal(ctxt, doc);
6762 if (!xmlValidateRoot(ctxt, doc))
return(0);
6764 root = xmlDocGetRootElement(doc);
6765 ret &= xmlValidateElement(ctxt, doc,
root);
6766 ret &= xmlValidateDocumentFinal(ctxt, doc);
6789xmlValidGetPotentialChildren(xmlElementContent *ctree,
6798 switch (ctree->type) {
6799 case XML_ELEMENT_CONTENT_PCDATA:
6800 for (
i = 0;
i < *
len;
i++)
6804 case XML_ELEMENT_CONTENT_ELEMENT:
6805 for (
i = 0;
i < *
len;
i++)
6809 case XML_ELEMENT_CONTENT_SEQ:
6810 xmlValidGetPotentialChildren(ctree->c1,
names,
len,
max);
6811 xmlValidGetPotentialChildren(ctree->c2,
names,
len,
max);
6813 case XML_ELEMENT_CONTENT_OR:
6814 xmlValidGetPotentialChildren(ctree->c1,
names,
len,
max);
6815 xmlValidGetPotentialChildren(ctree->c2,
names,
len,
max);
6856xmlValidGetValidElements(xmlNode *prev, xmlNode *
next,
const xmlChar **
names,
6859 int nb_valid_elements = 0;
6860 const xmlChar *elements[256]={0};
6861 int nb_elements = 0,
i;
6870 xmlNode *parent_childs;
6871 xmlNode *parent_last;
6873 xmlElement *element_desc;
6879 if (
max <= 0)
return(-1);
6882 vctxt.error = xmlNoValidityErr;
6884 nb_valid_elements = 0;
6885 ref_node = prev ? prev :
next;
6886 parent = ref_node->parent;
6896 if (element_desc ==
NULL)
return(-1);
6901 prev_next = prev ? prev->next :
NULL;
6903 parent_childs =
parent->children;
6904 parent_last =
parent->last;
6909 test_node = xmlNewDocNode (ref_node->doc,
NULL,
BAD_CAST "<!dummy?>",
NULL);
6910 if (test_node ==
NULL)
6913 test_node->parent =
parent;
6914 test_node->prev = prev;
6915 test_node->next =
next;
6918 if (prev) prev->next = test_node;
6919 else parent->children = test_node;
6922 else parent->last = test_node;
6928 nb_elements = xmlValidGetPotentialChildren(element_desc->content,
6929 elements, &nb_elements, 256);
6931 for (
i = 0;
i < nb_elements;
i++) {
6932 test_node->name = elements[
i];
6933 if (xmlValidateOneElement(&vctxt,
parent->doc,
parent)) {
6936 for (
j = 0;
j < nb_valid_elements;
j++)
6938 names[nb_valid_elements++] = elements[
i];
6939 if (nb_valid_elements >=
max)
break;
6946 if (prev) prev->next = prev_next;
6948 parent->children = parent_childs;
6949 parent->last = parent_last;
6954 test_node->name =
name;
6955 xmlFreeNode(test_node);
6957 return(nb_valid_elements);
void user(int argc, const char *argv[])
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
char ** glob(const char *v)
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
XMLPUBFUN xmlEntityPtr xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name)
@ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY
xmlEntitiesTable * xmlEntitiesTablePtr
static const struct access_res create[16]
XML_DEPRECATED XMLPUBFUN int xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar *cur, int *len)
static unsigned __int64 next
int xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
const xmlChar * xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
xmlReallocFunc xmlRealloc
void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
void * xmlHashLookup2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2)
int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key, xmlHashDeallocator dealloc)
int xmlHashRemoveEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, xmlHashDeallocator dealloc)
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
int xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload, xmlHashDeallocator dealloc)
xmlHashTablePtr xmlHashCopy(xmlHashTablePtr hash, xmlHashCopier copy)
int xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, void *payload)
int xmlHashAddEntry3(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, const xmlChar *key3, void *payload)
xmlHashTablePtr xmlHashCreateDict(int size, xmlDictPtr dict)
void * xmlHashLookup3(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, const xmlChar *key3)
void xmlHashScan3(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, const xmlChar *key3, xmlHashScanner scan, void *data)
XMLPUBFUN void xmlListWalk(xmlListPtr l, xmlListWalker walker, void *user)
XMLPUBFUN int xmlListAppend(xmlListPtr l, void *data)
XMLPUBFUN void * xmlLinkGetData(xmlLinkPtr lk)
XMLPUBFUN int xmlListRemoveFirst(xmlListPtr l, void *data)
XMLPUBFUN void xmlListDelete(xmlListPtr l)
XMLPUBFUN xmlListPtr xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
XMLPUBFUN int xmlListEmpty(xmlListPtr l)
XML_HIDDEN void __xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, void *ctx, void *nod, int domain, int code, xmlErrorLevel level, const char *file, int line, const char *str1, const char *str2, const char *str3, int int1, int col, const char *msg,...) LIBXML_ATTR_FORMAT(16
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
#define XML_VCTXT_USE_PCTXT
Character const *const prefix
XMLPUBFUN xmlChar * xmlBuildURI(const xmlChar *URI, const xmlChar *base)
int xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr)
static int xmlIsStreaming(xmlValidCtxtPtr ctxt)
static int xmlWalkRemoveRef(const void *data, void *user)
static void xmlVErrMemory(xmlValidCtxtPtr ctxt, const char *extra)
xmlRemoveMemo * xmlRemoveMemoPtr
int xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr)
void xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int englob)
static void xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED)
xmlValidateMemo * xmlValidateMemoPtr
static int xmlDummyCompare(const void *data0 ATTRIBUTE_UNUSED, const void *data1 ATTRIBUTE_UNUSED)
static xmlElementPtr xmlGetDtdElementDesc2(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, int create)
xmlAttributePtr xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *prefix)
xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr cur)
void xmlFreeIDTable(xmlIDTablePtr table)
static void xmlFreeID(xmlIDPtr id)
xmlNotationPtr xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, const xmlChar *PublicID, const xmlChar *SystemID)
static void xmlFreeNotation(xmlNotationPtr nota)
xmlElementPtr xmlGetDtdQElementDesc(xmlDtdPtr dtd, const xmlChar *name, const xmlChar *prefix)
xmlEnumerationPtr xmlCreateEnumeration(const xmlChar *name)
struct xmlValidateMemo_t xmlValidateMemo
xmlAttributePtr xmlGetDtdAttrDesc(xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name)
xmlIDPtr xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr)
void xmlFreeEnumeration(xmlEnumerationPtr cur)
xmlElementContentPtr xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur)
xmlElementContentPtr xmlNewDocElementContent(xmlDocPtr doc, const xmlChar *name, xmlElementContentType type)
static void xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED)
void xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur)
void xmlFreeRefTable(xmlRefTablePtr table)
static void xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
void xmlFreeNotationTable(xmlNotationTablePtr table)
static void xmlFreeElement(xmlElementPtr elem)
int xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr)
xmlElementContentPtr xmlNewElementContent(const xmlChar *name, xmlElementContentType type)
xmlListPtr xmlGetRefs(xmlDocPtr doc, const xmlChar *ID)
int xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr)
xmlElementPtr xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContentPtr content)
void xmlFreeElementContent(xmlElementContentPtr cur)
void xmlFreeElementTable(xmlElementTablePtr table)
xmlNotationPtr xmlGetDtdNotationDesc(xmlDtdPtr dtd, const xmlChar *name)
int xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name)
static void xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED)
xmlAttributePtr xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *ns, xmlAttributeType type, xmlAttributeDefault def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
static void xmlValidNormalizeString(xmlChar *str)
static void xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED)
static void xmlFreeRef(xmlLinkPtr lk)
xmlAttrPtr xmlGetID(xmlDocPtr doc, const xmlChar *ID)
xmlRefPtr xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr)
xmlElementPtr xmlGetDtdElementDesc(xmlDtdPtr dtd, const xmlChar *name)
void xmlFreeAttributeTable(xmlAttributeTablePtr table)
struct xmlRemoveMemo_t xmlRemoveMemo
static void xmlFreeAttribute(xmlAttributePtr attr)
xmlRefTable * xmlRefTablePtr
xmlIDTable * xmlIDTablePtr
xmlAttributeTable * xmlAttributeTablePtr
xmlElementTable * xmlElementTablePtr
xmlValidState * xmlValidStatePtr
xmlValidCtxt * xmlValidCtxtPtr
xmlNotationTable * xmlNotationTablePtr
struct _xmlValidState xmlValidState
typedeftypedef void(*) typedef void(*) struct _xmlValidCtx xmlValidCtxt)
static GLenum _GLUfuncptr fn
void(*) typedef void(* xmlStructuredErrorFunc)(void *userData, const xmlError *error)
void(* xmlGenericErrorFunc)(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
@ XML_DTD_ATTRIBUTE_REDEFINED
@ XML_DTD_DIFFERENT_PREFIX
@ XML_DTD_UNKNOWN_ATTRIBUTE
@ XML_DTD_INVALID_DEFAULT
@ XML_DTD_ATTRIBUTE_DEFAULT
@ XML_DTD_ELEM_DEFAULT_NAMESPACE
@ XML_DTD_MISSING_ATTRIBUTE
@ XML_DTD_CONTENT_NOT_DETERMINIST
@ XML_DTD_ATTRIBUTE_VALUE
@ XML_DTD_NOTATION_REDEFINED
@ XML_DTD_STANDALONE_WHITE_SPACE
@ XML_DTD_UNKNOWN_NOTATION
XMLPUBFUN xmlChar * xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN int xmlStrlen(const xmlChar *str)
XMLPUBFUN int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
#define LIBXML_ATTR_FORMAT(fmt, args)