fixing C14N bug with processing namespaces from attributes
diff --git a/c14n.c b/c14n.c
index 01c46b1..fd14d9c 100644
--- a/c14n.c
+++ b/c14n.c
@@ -176,7 +176,13 @@
 	    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