summaryrefslogtreecommitdiff
path: root/c14n.c
diff options
context:
space:
mode:
Diffstat (limited to 'c14n.c')
-rw-r--r--c14n.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/c14n.c b/c14n.c
index 01c46b1..fd14d9c 100644
--- a/c14n.c
+++ b/c14n.c
@@ -176,7 +176,13 @@ xmlC14NIsNodeInNodeset(xmlNodeSetPtr nodes, xmlNodePtr node, xmlNodePtr parent)
xmlNs ns;
memcpy(&ns, node, sizeof(ns));
- ns.next = (xmlNsPtr)parent; /* this is a libxml hack! check xpath.c for details */
+
+ /* this is a libxml hack! check xpath.c for details */
+ if((parent != NULL) && (parent->type == XML_ATTRIBUTE_NODE)) {
+ ns.next = (xmlNsPtr)parent->parent;
+ } else {
+ ns.next = (xmlNsPtr)parent;
+ }
/*
* If the input is an XPath node-set, then the node-set must explicitly