summaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2005-03-27 13:13:58 +0000
committerMike Hommey <glandium@debian.org>2005-03-27 13:13:58 +0000
commit50e5b428562964b1eb2f876370058b34b47c5e90 (patch)
treec66bcae6dbbce07128ee881353ff60090524462c /tree.c
parenta7457388701e6ccba9091ba3ec09505dc903b758 (diff)
downloadlibxml2-50e5b428562964b1eb2f876370058b34b47c5e90.tar.gz
Load /tmp/tmp.XJZ6qc/libxml2-2.6.18 intoupstream/2.6.18
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/tree.c b/tree.c
index 31511c5..7b88beb 100644
--- a/tree.c
+++ b/tree.c
@@ -4164,6 +4164,8 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
ret->name = xmlMemStrdup(doc->name);
if (doc->encoding != NULL)
ret->encoding = xmlStrdup(doc->encoding);
+ if (doc->URL != NULL)
+ ret->URL = xmlStrdup(doc->URL);
ret->charset = doc->charset;
ret->compression = doc->compression;
ret->standalone = doc->standalone;
@@ -4305,7 +4307,10 @@ xmlGetNodePath(xmlNodePtr node)
tmp = cur->prev;
while (tmp != NULL) {
if ((tmp->type == XML_ELEMENT_NODE) &&
- (xmlStrEqual(cur->name, tmp->name)))
+ (xmlStrEqual(cur->name, tmp->name)) &&
+ ((tmp->ns == cur->ns) ||
+ ((tmp->ns != NULL) && (cur->ns != NULL) &&
+ (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix)))))
occur++;
tmp = tmp->prev;
}
@@ -4313,7 +4318,10 @@ xmlGetNodePath(xmlNodePtr node)
tmp = cur->next;
while (tmp != NULL && occur == 0) {
if ((tmp->type == XML_ELEMENT_NODE) &&
- (xmlStrEqual(cur->name, tmp->name)))
+ (xmlStrEqual(cur->name, tmp->name)) &&
+ ((tmp->ns == cur->ns) ||
+ ((tmp->ns != NULL) && (cur->ns != NULL) &&
+ (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix)))))
occur++;
tmp = tmp->next;
}
@@ -5663,7 +5671,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
if ((cur->href != NULL) && (href != NULL) &&
(xmlStrEqual(cur->href, href))) {
if (((!is_attr) || (cur->prefix != NULL)) &&
- (xmlNsInScope(doc, orig, node, cur->href) == 1))
+ (xmlNsInScope(doc, orig, node, cur->prefix) == 1))
return (cur);
}
cur = cur->next;
@@ -5674,7 +5682,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
if ((cur->href != NULL) && (href != NULL) &&
(xmlStrEqual(cur->href, href))) {
if (((!is_attr) || (cur->prefix != NULL)) &&
- (xmlNsInScope(doc, orig, node, cur->href) == 1))
+ (xmlNsInScope(doc, orig, node, cur->prefix) == 1))
return (cur);
}
}
@@ -6438,7 +6446,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
const xmlChar *value) {
xmlAttrPtr prop;
- if ((node == NULL) || (name == NULL))
+ if ((node == NULL) || (name == NULL) || (node->type != XML_ELEMENT_NODE))
return(NULL);
if (ns == NULL)