fixing rendering of attributes when parent node is not in the node set
diff --git a/c14n.c b/c14n.c
index 5f18581..32c7004 100644
--- a/c14n.c
+++ b/c14n.c
@@ -946,6 +946,7 @@
  * xmlC14NProcessAttrsAxis:
  * @ctx: 		the C14N context
  * @cur:		the current node
+ * @parent_visible:	the visibility of parent node
  *
  * Prints out canonical attribute axis of the current node to the
  * buffer from C14N context as follows 
@@ -974,7 +975,7 @@
  * Returns 0 on success or -1 on fail.
  */
 static int
-xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur)
+xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible)
 {
     xmlAttrPtr attr;
     xmlListPtr list;
@@ -1009,7 +1010,7 @@
      * include attributes in "xml" namespace defined in ancestors
      * (only for non-exclusive XML Canonicalization)
      */
-    if ((!ctx->exclusive) && (cur->parent != NULL)
+    if (parent_visible && (!ctx->exclusive) && (cur->parent != NULL)
         && (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) {
         /*
          * If XPath node-set is not specified then the parent is always 
@@ -1171,12 +1172,10 @@
 	xmlC14NVisibleNsStackShift(ctx->ns_rendered);
     }
     
-    if(visible) {
-	ret = xmlC14NProcessAttrsAxis(ctx, cur);
-	if (ret < 0) {
-        xmlC14NErrInternal("processing attributes axis");
-    	    return (-1);
-	}
+    ret = xmlC14NProcessAttrsAxis(ctx, cur, visible);
+    if (ret < 0) {
+	xmlC14NErrInternal("processing attributes axis");
+    	return (-1);
     }
 
     if (visible) {