mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
tree: Allocate XML namespace statically
This commit is contained in:
13
debugXML.c
13
debugXML.c
@@ -101,6 +101,10 @@ xmlNsCheckScope(xmlNodePtr node, xmlNsPtr ns)
|
||||
(node->type != XML_XINCLUDE_START))
|
||||
return(-2);
|
||||
|
||||
/* xml namespace */
|
||||
if (xmlStrEqual(ns->prefix, BAD_CAST "xml"))
|
||||
return(1);
|
||||
|
||||
while ((node != NULL) &&
|
||||
((node->type == XML_ELEMENT_NODE) ||
|
||||
(node->type == XML_ATTRIBUTE_NODE) ||
|
||||
@@ -119,14 +123,7 @@ xmlNsCheckScope(xmlNodePtr node, xmlNsPtr ns)
|
||||
}
|
||||
node = node->parent;
|
||||
}
|
||||
/* the xml namespace may be declared on the document node */
|
||||
if ((node != NULL) &&
|
||||
((node->type == XML_DOCUMENT_NODE) ||
|
||||
(node->type == XML_HTML_DOCUMENT_NODE))) {
|
||||
xmlNsPtr oldNs = ((xmlDocPtr) node)->oldNs;
|
||||
if (oldNs == ns)
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(-3);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user