Re: [xml] small patch to c14n.c



Sorry, but I have one more small patch to fix problems
with processing attributes with default namespaces
in exc-c14n.


Thanks,

Aleksey.



Daniel Veillard wrote:
On Fri, Mar 15, 2002 at 01:15:52AM -0800, Aleksey Sanin wrote:
Thanks a lot! I hate to say this but I just found one more bug. Please find
the diff attached.

Commited too,

thanks,

Daniel


Index: c14n.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/c14n.c,v
retrieving revision 1.5
diff -c -r1.5 c14n.c
*** c14n.c      2002/03/15 09:42:33     1.5
--- c14n.c      2002/03/16 19:11:32
***************
*** 437,456 ****
      attr = cur->properties;
      while (attr != NULL) {
          /* 
!          * todo: do we need to check that attribute is visible and has non
!          * default namespace
           */
!         if (xmlC14NIsVisible(ctx, attr)) {
!             ns = (attr->ns != NULL) ? attr->ns : xmlSearchNs(ctx->doc, cur,
!                                                              NULL);
!             if ((ns != NULL) && (xmlC14NIsVisible(ctx, attr)) &&
!                 (!xmlC14NIsXmlNs(ns))) {
!                 if ((xmlListSearch(list, ns) == NULL)
!                     && (!xmlExcC14NIsRendered(ctx, ns))) {
!                     xmlListInsert(list, ns);
!                     xmlXPathNodeSetAdd(ctx->ns_rendered, (xmlNodePtr) ns);
!                 }
!             }
          }
          attr = attr->next;
      }
--- 437,451 ----
      attr = cur->properties;
      while (attr != NULL) {
          /* 
!          * we need to check that attribute is visible and has non
!          * default namespace (XML Namespaces: "default namespaces 
!          * 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);
          }
          attr = attr->next;
      }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]