version 1.71, 2000/09/16 19:45:06
|
version 1.72, 2000/10/01 20:29:37
|
Line 567 xmlAddElementDecl(xmlValidCtxtPtr ctxt,
|
Line 567 xmlAddElementDecl(xmlValidCtxtPtr ctxt,
|
cur = table->table[i]; |
cur = table->table[i]; |
if ((ns != NULL) && (cur->prefix == NULL)) continue; |
if ((ns != NULL) && (cur->prefix == NULL)) continue; |
if ((ns == NULL) && (cur->prefix != NULL)) continue; |
if ((ns == NULL) && (cur->prefix != NULL)) continue; |
if ((!xmlStrcmp(cur->name, name)) && |
if ((xmlStrEqual(cur->name, name)) && |
((ns == NULL) || (!xmlStrcmp(cur->prefix, ns)))) { |
((ns == NULL) || (xmlStrEqual(cur->prefix, ns)))) { |
/* |
/* |
* The element is already defined in this Dtd. |
* The element is already defined in this Dtd. |
*/ |
*/ |
Line 927 xmlScanAttributeDecl(xmlDtdPtr dtd, cons
|
Line 927 xmlScanAttributeDecl(xmlDtdPtr dtd, cons
|
return(NULL); |
return(NULL); |
|
|
for (i = 0;i < table->nb_attributes;i++) { |
for (i = 0;i < table->nb_attributes;i++) { |
if (!xmlStrcmp(table->table[i]->elem, elem)) { |
if (xmlStrEqual(table->table[i]->elem, elem)) { |
table->table[i]->nexth = ret; |
table->table[i]->nexth = ret; |
ret = table->table[i]; |
ret = table->table[i]; |
} |
} |
Line 1080 xmlAddAttributeDecl(xmlValidCtxtPtr ctxt
|
Line 1080 xmlAddAttributeDecl(xmlValidCtxtPtr ctxt
|
cur = cur->nexth; |
cur = cur->nexth; |
continue; |
continue; |
} |
} |
if ((!xmlStrcmp(cur->name, name)) && |
if ((xmlStrEqual(cur->name, name)) && |
((ns == NULL) || (!xmlStrcmp(cur->prefix, ns)))) { |
((ns == NULL) || (xmlStrEqual(cur->prefix, ns)))) { |
/* |
/* |
* The attribute is already defined in this Dtd. |
* The attribute is already defined in this Dtd. |
*/ |
*/ |
Line 1101 xmlAddAttributeDecl(xmlValidCtxtPtr ctxt
|
Line 1101 xmlAddAttributeDecl(xmlValidCtxtPtr ctxt
|
cur = table->table[i]; |
cur = table->table[i]; |
if ((ns != NULL) && (cur->prefix == NULL)) continue; |
if ((ns != NULL) && (cur->prefix == NULL)) continue; |
if ((ns == NULL) && (cur->prefix != NULL)) continue; |
if ((ns == NULL) && (cur->prefix != NULL)) continue; |
if ((!xmlStrcmp(cur->name, name)) && |
if ((xmlStrEqual(cur->name, name)) && |
(!xmlStrcmp(cur->elem, elem)) && |
(xmlStrEqual(cur->elem, elem)) && |
((ns == NULL) || (!xmlStrcmp(cur->prefix, ns)))) { |
((ns == NULL) || (xmlStrEqual(cur->prefix, ns)))) { |
/* |
/* |
* The attribute is already defined in this Dtd. |
* The attribute is already defined in this Dtd. |
*/ |
*/ |
Line 1461 xmlAddNotationDecl(xmlValidCtxtPtr ctxt,
|
Line 1461 xmlAddNotationDecl(xmlValidCtxtPtr ctxt,
|
*/ |
*/ |
for (i = 0;i < table->nb_notations;i++) { |
for (i = 0;i < table->nb_notations;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->name, name)) { |
if (xmlStrEqual(cur->name, name)) { |
/* |
/* |
* The notation is already defined in this Dtd. |
* The notation is already defined in this Dtd. |
*/ |
*/ |
Line 1730 xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr
|
Line 1730 xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr
|
*/ |
*/ |
for (i = 0;i < table->nb_ids;i++) { |
for (i = 0;i < table->nb_ids;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->value, value)) { |
if (xmlStrEqual(cur->value, value)) { |
/* |
/* |
* The id is already defined in this Dtd. |
* The id is already defined in this Dtd. |
*/ |
*/ |
Line 1827 xmlIsID(xmlDocPtr doc, xmlNodePtr elem,
|
Line 1827 xmlIsID(xmlDocPtr doc, xmlNodePtr elem,
|
((attr->name[1] == 'D') || (attr->name[1] == 'd')) && |
((attr->name[1] == 'D') || (attr->name[1] == 'd')) && |
(attr->name[2] == 0)) return(1); |
(attr->name[2] == 0)) return(1); |
} else if (doc->type == XML_HTML_DOCUMENT_NODE) { |
} else if (doc->type == XML_HTML_DOCUMENT_NODE) { |
if ((!xmlStrcmp(BAD_CAST "id", attr->name)) || |
if ((xmlStrEqual(BAD_CAST "id", attr->name)) || |
(!xmlStrcmp(BAD_CAST "name", attr->name))) |
(xmlStrEqual(BAD_CAST "name", attr->name))) |
return(1); |
return(1); |
return(0); |
return(0); |
} else { |
} else { |
Line 1916 xmlGetID(xmlDocPtr doc, const xmlChar *I
|
Line 1916 xmlGetID(xmlDocPtr doc, const xmlChar *I
|
*/ |
*/ |
for (i = 0;i < table->nb_ids;i++) { |
for (i = 0;i < table->nb_ids;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->value, ID)) { |
if (xmlStrEqual(cur->value, ID)) { |
return(cur->attr); |
return(cur->attr); |
} |
} |
} |
} |
Line 2177 xmlGetRef(xmlDocPtr doc, const xmlChar *
|
Line 2177 xmlGetRef(xmlDocPtr doc, const xmlChar *
|
*/ |
*/ |
for (i = 0;i < table->nb_refs;i++) { |
for (i = 0;i < table->nb_refs;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->value, Ref)) { |
if (xmlStrEqual(cur->value, Ref)) { |
return(cur->attr); |
return(cur->attr); |
} |
} |
} |
} |
Line 2213 xmlGetDtdElementDesc(xmlDtdPtr dtd, cons
|
Line 2213 xmlGetDtdElementDesc(xmlDtdPtr dtd, cons
|
|
|
if ((table->last >= 0) && (table->last < table->nb_elements)) { |
if ((table->last >= 0) && (table->last < table->nb_elements)) { |
cur = table->table[table->last]; |
cur = table->table[table->last]; |
if (!xmlStrcmp(cur->name, name)) |
if (xmlStrEqual(cur->name, name)) |
return(cur); |
return(cur); |
} |
} |
for (i = 0;i < table->nb_elements;i++) { |
for (i = 0;i < table->nb_elements;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->name, name)) { |
if (xmlStrEqual(cur->name, name)) { |
table->last = i; |
table->last = i; |
return(cur); |
return(cur); |
} |
} |
Line 2232 xmlGetDtdElementDesc(xmlDtdPtr dtd, cons
|
Line 2232 xmlGetDtdElementDesc(xmlDtdPtr dtd, cons
|
|
|
for (i = 0;i < table->nb_elements;i++) { |
for (i = 0;i < table->nb_elements;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if ((!xmlStrcmp(cur->name, uqname)) && |
if ((xmlStrEqual(cur->name, uqname)) && |
((prefix == cur->prefix) || |
((prefix == cur->prefix) || |
((prefix != NULL) && (cur->prefix != NULL) && |
((prefix != NULL) && (cur->prefix != NULL) && |
(!xmlStrcmp(cur->prefix, prefix))))) { |
(xmlStrEqual(cur->prefix, prefix))))) { |
if (prefix != NULL) xmlFree(prefix); |
if (prefix != NULL) xmlFree(prefix); |
if (uqname != NULL) xmlFree(uqname); |
if (uqname != NULL) xmlFree(uqname); |
return(cur); |
return(cur); |
Line 2270 xmlGetDtdQElementDesc(xmlDtdPtr dtd, con
|
Line 2270 xmlGetDtdQElementDesc(xmlDtdPtr dtd, con
|
|
|
for (i = 0;i < table->nb_elements;i++) { |
for (i = 0;i < table->nb_elements;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->name, name) && |
if (xmlStrEqual(cur->name, name) && |
((prefix == cur->prefix) || |
((prefix == cur->prefix) || |
((prefix != NULL) && (cur->prefix != NULL) && |
((prefix != NULL) && (cur->prefix != NULL) && |
(!xmlStrcmp(cur->prefix, prefix))))) |
(xmlStrEqual(cur->prefix, prefix))))) |
return(cur); |
return(cur); |
} |
} |
return(NULL); |
return(NULL); |
Line 2310 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
Line 2310 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
if (etable != NULL) { |
if (etable != NULL) { |
for (i = 0;i < etable->nb_elements;i++) { |
for (i = 0;i < etable->nb_elements;i++) { |
ecur = etable->table[i]; |
ecur = etable->table[i]; |
if (!xmlStrcmp(ecur->name, elem)) { |
if (xmlStrEqual(ecur->name, elem)) { |
cur = ecur->attributes; |
cur = ecur->attributes; |
while (cur != NULL) { |
while (cur != NULL) { |
if (!xmlStrcmp(cur->name, name)) |
if (xmlStrEqual(cur->name, name)) |
return(cur); |
return(cur); |
cur = cur->nexth; |
cur = cur->nexth; |
} |
} |
Line 2331 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
Line 2331 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
return(NULL); |
return(NULL); |
for (i = 0;i < table->nb_attributes;i++) { |
for (i = 0;i < table->nb_attributes;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if ((!xmlStrcmp(cur->name, name)) && |
if ((xmlStrEqual(cur->name, name)) && |
(!xmlStrcmp(cur->elem, elem))) |
(xmlStrEqual(cur->elem, elem))) |
return(cur); |
return(cur); |
} |
} |
|
|
Line 2344 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
Line 2344 xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
|
|
|
for (i = 0;i < table->nb_attributes;i++) { |
for (i = 0;i < table->nb_attributes;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if ((!xmlStrcmp(cur->name, uqname)) && |
if ((xmlStrEqual(cur->name, uqname)) && |
(!xmlStrcmp(cur->elem, elem)) && |
(xmlStrEqual(cur->elem, elem)) && |
((prefix == cur->prefix) || |
((prefix == cur->prefix) || |
((prefix != NULL) && (cur->prefix != NULL) && |
((prefix != NULL) && (cur->prefix != NULL) && |
(!xmlStrcmp(cur->prefix, prefix))))) { |
(xmlStrEqual(cur->prefix, prefix))))) { |
if (prefix != NULL) xmlFree(prefix); |
if (prefix != NULL) xmlFree(prefix); |
if (uqname != NULL) xmlFree(uqname); |
if (uqname != NULL) xmlFree(uqname); |
return(cur); |
return(cur); |
Line 2385 xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const
|
Line 2385 xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const
|
|
|
for (i = 0;i < table->nb_attributes;i++) { |
for (i = 0;i < table->nb_attributes;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if ((!xmlStrcmp(cur->name, name)) && |
if ((xmlStrEqual(cur->name, name)) && |
(!xmlStrcmp(cur->elem, elem)) && |
(xmlStrEqual(cur->elem, elem)) && |
((prefix == cur->prefix) || |
((prefix == cur->prefix) || |
((prefix != NULL) && (cur->prefix != NULL) && |
((prefix != NULL) && (cur->prefix != NULL) && |
(!xmlStrcmp(cur->prefix, prefix))))) |
(xmlStrEqual(cur->prefix, prefix))))) |
return(cur); |
return(cur); |
} |
} |
return(NULL); |
return(NULL); |
Line 2417 xmlGetDtdNotationDesc(xmlDtdPtr dtd, con
|
Line 2417 xmlGetDtdNotationDesc(xmlDtdPtr dtd, con
|
|
|
for (i = 0;i < table->nb_notations;i++) { |
for (i = 0;i < table->nb_notations;i++) { |
cur = table->table[i]; |
cur = table->table[i]; |
if (!xmlStrcmp(cur->name, name)) |
if (xmlStrEqual(cur->name, name)) |
return(cur); |
return(cur); |
} |
} |
return(NULL); |
return(NULL); |
Line 2988 xmlValidateAttributeDecl(xmlValidCtxtPtr
|
Line 2988 xmlValidateAttributeDecl(xmlValidCtxtPtr
|
if (table != NULL) { |
if (table != NULL) { |
for (i = 0;i < table->nb_attributes;i++) { |
for (i = 0;i < table->nb_attributes;i++) { |
if ((table->table[i]->atype == XML_ATTRIBUTE_ID) && |
if ((table->table[i]->atype == XML_ATTRIBUTE_ID) && |
(!xmlStrcmp(table->table[i]->elem, attr->elem))) { |
(xmlStrEqual(table->table[i]->elem, attr->elem))) { |
nbId++; |
nbId++; |
} |
} |
} |
} |
Line 3020 xmlValidateAttributeDecl(xmlValidCtxtPtr
|
Line 3020 xmlValidateAttributeDecl(xmlValidCtxtPtr
|
if ((attr->defaultValue != NULL) && (attr->tree != NULL)) { |
if ((attr->defaultValue != NULL) && (attr->tree != NULL)) { |
xmlEnumerationPtr tree = attr->tree; |
xmlEnumerationPtr tree = attr->tree; |
while (tree != NULL) { |
while (tree != NULL) { |
if (!xmlStrcmp(tree->name, attr->defaultValue)) break; |
if (xmlStrEqual(tree->name, attr->defaultValue)) break; |
tree = tree->next; |
tree = tree->next; |
} |
} |
if (tree == NULL) { |
if (tree == NULL) { |
Line 3074 xmlValidateElementDecl(xmlValidCtxtPtr c
|
Line 3074 xmlValidateElementDecl(xmlValidCtxtPtr c
|
next = cur->c2; |
next = cur->c2; |
while (next != NULL) { |
while (next != NULL) { |
if (next->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (next->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (!xmlStrcmp(next->name, name)) { |
if (xmlStrEqual(next->name, name)) { |
VERROR(ctxt->userData, |
VERROR(ctxt->userData, |
"Definition of %s has duplicate references of %s\n", |
"Definition of %s has duplicate references of %s\n", |
elem->name, name); |
elem->name, name); |
Line 3084 xmlValidateElementDecl(xmlValidCtxtPtr c
|
Line 3084 xmlValidateElementDecl(xmlValidCtxtPtr c
|
} |
} |
if (next->c1 == NULL) break; |
if (next->c1 == NULL) break; |
if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break; |
if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break; |
if (!xmlStrcmp(next->c1->name, name)) { |
if (xmlStrEqual(next->c1->name, name)) { |
VERROR(ctxt->userData, |
VERROR(ctxt->userData, |
"Definition of %s has duplicate references of %s\n", |
"Definition of %s has duplicate references of %s\n", |
elem->name, name); |
elem->name, name); |
Line 3213 xmlValidateOneAttribute(xmlValidCtxtPtr
|
Line 3213 xmlValidateOneAttribute(xmlValidCtxtPtr
|
|
|
/* Validity constraint: Fixed Attribute Default */ |
/* Validity constraint: Fixed Attribute Default */ |
if (attrDecl->def == XML_ATTRIBUTE_FIXED) { |
if (attrDecl->def == XML_ATTRIBUTE_FIXED) { |
if (xmlStrcmp(value, attrDecl->defaultValue)) { |
if (!xmlStrEqual(value, attrDecl->defaultValue)) { |
VERROR(ctxt->userData, |
VERROR(ctxt->userData, |
"Value for attribute %s on %s is differnt from default \"%s\"\n", |
"Value for attribute %s on %s is differnt from default \"%s\"\n", |
attr->name, elem->name, attrDecl->defaultValue); |
attr->name, elem->name, attrDecl->defaultValue); |
Line 3250 xmlValidateOneAttribute(xmlValidCtxtPtr
|
Line 3250 xmlValidateOneAttribute(xmlValidCtxtPtr
|
|
|
/* Second, verify that it's among the list */ |
/* Second, verify that it's among the list */ |
while (tree != NULL) { |
while (tree != NULL) { |
if (!xmlStrcmp(tree->name, value)) break; |
if (xmlStrEqual(tree->name, value)) break; |
tree = tree->next; |
tree = tree->next; |
} |
} |
if (tree == NULL) { |
if (tree == NULL) { |
Line 3265 xmlValidateOneAttribute(xmlValidCtxtPtr
|
Line 3265 xmlValidateOneAttribute(xmlValidCtxtPtr
|
if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) { |
if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) { |
xmlEnumerationPtr tree = attrDecl->tree; |
xmlEnumerationPtr tree = attrDecl->tree; |
while (tree != NULL) { |
while (tree != NULL) { |
if (!xmlStrcmp(tree->name, value)) break; |
if (xmlStrEqual(tree->name, value)) break; |
tree = tree->next; |
tree = tree->next; |
} |
} |
if (tree == NULL) { |
if (tree == NULL) { |
Line 3278 xmlValidateOneAttribute(xmlValidCtxtPtr
|
Line 3278 xmlValidateOneAttribute(xmlValidCtxtPtr
|
|
|
/* Fixed Attribute Default */ |
/* Fixed Attribute Default */ |
if ((attrDecl->def == XML_ATTRIBUTE_FIXED) && |
if ((attrDecl->def == XML_ATTRIBUTE_FIXED) && |
(xmlStrcmp(attrDecl->defaultValue, value))) { |
(!xmlStrEqual(attrDecl->defaultValue, value))) { |
VERROR(ctxt->userData, |
VERROR(ctxt->userData, |
"Value for attribute %s on %s must be \"%s\"\n", |
"Value for attribute %s on %s must be \"%s\"\n", |
attr->name, elem->name, attrDecl->defaultValue); |
attr->name, elem->name, attrDecl->defaultValue); |
Line 3352 xmlValidateElementTypeExpr(xmlValidCtxtP
|
Line 3352 xmlValidateElementTypeExpr(xmlValidCtxtP
|
return(0); |
return(0); |
case XML_ELEMENT_CONTENT_ELEMENT: |
case XML_ELEMENT_CONTENT_ELEMENT: |
if (*child == NULL) return(0); |
if (*child == NULL) return(0); |
ret = (!xmlStrcmp((*child)->name, cont->name)); |
ret = (xmlStrEqual((*child)->name, cont->name)); |
if (ret == 1) { |
if (ret == 1) { |
while ((*child)->next == NULL) { |
while ((*child)->next == NULL) { |
if (((*child)->parent != NULL) && |
if (((*child)->parent != NULL) && |
Line 3738 xmlValidateOneElement(xmlValidCtxtPtr ct
|
Line 3738 xmlValidateOneElement(xmlValidCtxtPtr ct
|
cont = elemDecl->content; |
cont = elemDecl->content; |
while (cont != NULL) { |
while (cont != NULL) { |
if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (!xmlStrcmp(cont->name, qname)) break; |
if (xmlStrEqual(cont->name, qname)) break; |
} else if ((cont->type == XML_ELEMENT_CONTENT_OR) && |
} else if ((cont->type == XML_ELEMENT_CONTENT_OR) && |
(cont->c1 != NULL) && |
(cont->c1 != NULL) && |
(cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){ |
(cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){ |
if (!xmlStrcmp(cont->c1->name, qname)) break; |
if (xmlStrEqual(cont->c1->name, qname)) break; |
} else if ((cont->type != XML_ELEMENT_CONTENT_OR) || |
} else if ((cont->type != XML_ELEMENT_CONTENT_OR) || |
(cont->c1 == NULL) || |
(cont->c1 == NULL) || |
(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ |
(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ |
Line 3758 xmlValidateOneElement(xmlValidCtxtPtr ct
|
Line 3758 xmlValidateOneElement(xmlValidCtxtPtr ct
|
cont = elemDecl->content; |
cont = elemDecl->content; |
while (cont != NULL) { |
while (cont != NULL) { |
if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) { |
if (!xmlStrcmp(cont->name, name)) break; |
if (xmlStrEqual(cont->name, name)) break; |
} else if ((cont->type == XML_ELEMENT_CONTENT_OR) && |
} else if ((cont->type == XML_ELEMENT_CONTENT_OR) && |
(cont->c1 != NULL) && |
(cont->c1 != NULL) && |
(cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) { |
(cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) { |
if (!xmlStrcmp(cont->c1->name, name)) break; |
if (xmlStrEqual(cont->c1->name, name)) break; |
} else if ((cont->type != XML_ELEMENT_CONTENT_OR) || |
} else if ((cont->type != XML_ELEMENT_CONTENT_OR) || |
(cont->c1 == NULL) || |
(cont->c1 == NULL) || |
(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) { |
(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) { |
Line 3813 child_ok:
|
Line 3813 child_ok:
|
|
|
attrib = elem->properties; |
attrib = elem->properties; |
while (attrib != NULL) { |
while (attrib != NULL) { |
if (!xmlStrcmp(attrib->name, attr->name)) { |
if (xmlStrEqual(attrib->name, attr->name)) { |
if (attr->prefix != NULL) { |
if (attr->prefix != NULL) { |
xmlNsPtr nameSpace = attrib->ns; |
xmlNsPtr nameSpace = attrib->ns; |
|
|
Line 3827 child_ok:
|
Line 3827 child_ok:
|
if (nameSpace == NULL) { |
if (nameSpace == NULL) { |
if (qualified < 0) |
if (qualified < 0) |
qualified = 0; |
qualified = 0; |
} else if (xmlStrcmp(nameSpace->prefix, attr->prefix)) { |
} else if (!xmlStrEqual(nameSpace->prefix, attr->prefix)) { |
if (qualified < 1) |
if (qualified < 1) |
qualified = 1; |
qualified = 1; |
} else |
} else |
Line 3903 xmlValidateRoot(xmlValidCtxtPtr ctxt, xm
|
Line 3903 xmlValidateRoot(xmlValidCtxtPtr ctxt, xm
|
/* |
/* |
* Check first the document root against the NQName |
* Check first the document root against the NQName |
*/ |
*/ |
if (xmlStrcmp(doc->intSubset->name, root->name)) { |
if (!xmlStrEqual(doc->intSubset->name, root->name)) { |
if ((root->ns != NULL) && (root->ns->prefix != NULL)) { |
if ((root->ns != NULL) && (root->ns->prefix != NULL)) { |
xmlChar qname[500]; |
xmlChar qname[500]; |
#ifdef HAVE_SNPRINTF |
#ifdef HAVE_SNPRINTF |
Line 3913 xmlValidateRoot(xmlValidCtxtPtr ctxt, xm
|
Line 3913 xmlValidateRoot(xmlValidCtxtPtr ctxt, xm
|
sprintf((char *) qname, "%s:%s", root->ns->prefix, root->name); |
sprintf((char *) qname, "%s:%s", root->ns->prefix, root->name); |
#endif |
#endif |
qname[sizeof(qname) - 1] = 0; |
qname[sizeof(qname) - 1] = 0; |
if (!xmlStrcmp(doc->intSubset->name, qname)) |
if (xmlStrEqual(doc->intSubset->name, qname)) |
goto name_ok; |
goto name_ok; |
} |
} |
if ((!xmlStrcmp(doc->intSubset->name, BAD_CAST "HTML")) && |
if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) && |
(!xmlStrcmp(root->name, BAD_CAST "html"))) |
(xmlStrEqual(root->name, BAD_CAST "html"))) |
goto name_ok; |
goto name_ok; |
VERROR(ctxt->userData, |
VERROR(ctxt->userData, |
"Not valid: root and DtD name do not match '%s' and '%s'\n", |
"Not valid: root and DtD name do not match '%s' and '%s'\n", |
Line 4255 xmlValidGetPotentialChildren(xmlElementC
|
Line 4255 xmlValidGetPotentialChildren(xmlElementC
|
switch (ctree->type) { |
switch (ctree->type) { |
case XML_ELEMENT_CONTENT_PCDATA: |
case XML_ELEMENT_CONTENT_PCDATA: |
for (i = 0; i < *len;i++) |
for (i = 0; i < *len;i++) |
if (!xmlStrcmp(BAD_CAST "#PCDATA", list[i])) return(*len); |
if (xmlStrEqual(BAD_CAST "#PCDATA", list[i])) return(*len); |
list[(*len)++] = BAD_CAST "#PCDATA"; |
list[(*len)++] = BAD_CAST "#PCDATA"; |
break; |
break; |
case XML_ELEMENT_CONTENT_ELEMENT: |
case XML_ELEMENT_CONTENT_ELEMENT: |
for (i = 0; i < *len;i++) |
for (i = 0; i < *len;i++) |
if (!xmlStrcmp(ctree->name, list[i])) return(*len); |
if (xmlStrEqual(ctree->name, list[i])) return(*len); |
list[(*len)++] = ctree->name; |
list[(*len)++] = ctree->name; |
break; |
break; |
case XML_ELEMENT_CONTENT_SEQ: |
case XML_ELEMENT_CONTENT_SEQ: |
Line 4375 xmlValidGetValidElements(xmlNode *prev,
|
Line 4375 xmlValidGetValidElements(xmlNode *prev,
|
int j; |
int j; |
|
|
for (j = 0; j < nb_valid_elements;j++) |
for (j = 0; j < nb_valid_elements;j++) |
if (!xmlStrcmp(elements[i], list[j])) break; |
if (xmlStrEqual(elements[i], list[j])) break; |
list[nb_valid_elements++] = elements[i]; |
list[nb_valid_elements++] = elements[i]; |
if (nb_valid_elements >= max) break; |
if (nb_valid_elements >= max) break; |
} |
} |