[xml] patch: xmlTextReaderHasAttributes doesnt account for nsDef



xmlTextReaderHasAttributes doesnt account for namespace declarations so when
an element doesnt conatin attributes, but has an nsDef,
xmlTextReaderHasAttributes will return 0 while xmlTextReaderAttributeCount
will return 1. Following patch checks for nsDef.

Index: xmlreader.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xmlreader.c,v
retrieving revision 1.111
diff -c -r1.111 xmlreader.c
*** xmlreader.c 6 Nov 2004 19:24:28 -0000 1.111
--- xmlreader.c 19 Nov 2004 11:36:58 -0000
***************
*** 3215,3221 ****
   node = reader->node;

      if ((node->type == XML_ELEMENT_NODE) &&
!  (node->properties != NULL))
   return(1);
      /* TODO: handle the xmlDecl */
      return(0);
--- 3215,3221 ----
   node = reader->node;

      if ((node->type == XML_ELEMENT_NODE) &&
!  ((node->properties != NULL) || (node->nsDef != NULL)))
   return(1);
      /* TODO: handle the xmlDecl */
      return(0);





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