summaryrefslogtreecommitdiff
path: root/c14n.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-03-15 07:57:50 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-03-15 07:57:50 +0000
commit5c39654822daf2e4d06a63d78930f22b2f122d99 (patch)
tree822eb5fa34d080a7890fb26f6b2ffd669d730925 /c14n.c
parent9be6586ca9368ac08e469351ef5e9322083acad0 (diff)
downloadlibxml2-5c39654822daf2e4d06a63d78930f22b2f122d99.tar.gz
applied patch from Aleksey Sanin fixing a problem in the canonicalization
* c14n.c: applied patch from Aleksey Sanin fixing a problem in the canonicalization algorithm * doc/xml.html doc/index.html: added the C14N references on the index page. Daniel
Diffstat (limited to 'c14n.c')
-rw-r--r--c14n.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/c14n.c b/c14n.c
index 7aab5394..27e25b82 100644
--- a/c14n.c
+++ b/c14n.c
@@ -266,8 +266,9 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
xmlNsPtr ns;
xmlListPtr list;
xmlNodePtr visible_parent;
+ xmlNodePtr node;
xmlNsPtr prev;
-
+
if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
#ifdef DEBUG_C14N
xmlGenericError(xmlGenericErrorContext,
@@ -302,6 +303,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
* defined in node parents). By this we need to now walk thru
* all namespace in current node and all invisible ancesstors
*/
+ node = cur;
while (cur != visible_parent) {
for (ns = cur->nsDef; ns != NULL; ns = ns->next) {
/*
@@ -311,6 +313,11 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
if ((xmlC14NIsXmlNs(ns)) || (xmlListSearch(list, ns) != NULL)) {
continue;
}
+ prev = xmlSearchNs(ctx->doc, node, ns->prefix);
+ if(prev != ns) {
+ /* we already processed a namespace with this name */
+ continue;
+ }
/*
* Lookup nearest namespace after visible parent having