patch from Aleksey Sanin reflecting a change in the ExcC14N specification

* c14n.c: patch from Aleksey Sanin reflecting a change in the
  ExcC14N specification
Daniel
This commit is contained in:
Daniel Veillard 2002-04-18 21:00:44 +00:00
parent bf8dae8a9c
commit 547611303e
2 changed files with 11 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Thu Apr 18 23:00:02 CEST 2002 Daniel Veillard <daniel@veillard.com>
* c14n.c: patch from Aleksey Sanin reflecting a change in the
ExcC14N specification
Thu Apr 18 18:38:30 CEST 2002 Daniel Veillard <daniel@veillard.com>
* tree.c: patch from Markus Henke, fix for recursive entities.

14
c14n.c
View File

@ -425,15 +425,13 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
/*
* First of all, add all namespaces required by current node
* (i.e. node namespace and all attribute namespaces)
* todo: do we need to check for default "xml:" namespace
* we also need to check for default "xml:" namespace
*/
ns = (cur->ns != NULL) ? cur->ns : xmlSearchNs(ctx->doc, cur, NULL);
if ((ns != NULL) && (!xmlC14NIsXmlNs(ns)) &&
(xmlListSearch(list, ns) == NULL)) {
if (!xmlExcC14NIsRendered(ctx, ns)) {
(xmlListSearch(list, ns) == NULL) && !xmlExcC14NIsRendered(ctx, ns)) {
xmlListInsert(list, ns);
xmlXPathNodeSetAdd(ctx->ns_rendered, (xmlNodePtr) ns);
}
}
attr = cur->properties;
while (attr != NULL) {
@ -443,10 +441,10 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
* do not apply directly to attributes")
*/
if ((attr->ns != NULL) && xmlC14NIsVisible(ctx, attr) &&
(xmlListSearch(list, attr->ns) == NULL) &&
(!xmlExcC14NIsRendered(ctx, attr->ns))) {
xmlListInsert(list, attr->ns);
xmlXPathNodeSetAdd(ctx->ns_rendered, (xmlNodePtr) attr->ns);
(!xmlC14NIsXmlNs(attr->ns)) &&
(xmlListSearch(list, attr->ns) == NULL) && (!xmlExcC14NIsRendered(ctx, attr->ns))) {
xmlListInsert(list, attr->ns);
xmlXPathNodeSetAdd(ctx->ns_rendered, (xmlNodePtr) attr->ns);
}
attr = attr->next;
}