diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-03-15 07:57:50 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-03-15 07:57:50 +0000 |
commit | 5c39654822daf2e4d06a63d78930f22b2f122d99 (patch) | |
tree | 822eb5fa34d080a7890fb26f6b2ffd669d730925 /c14n.c | |
parent | 9be6586ca9368ac08e469351ef5e9322083acad0 (diff) | |
download | libxml2-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |