Re: [gdome] HasAttributes - NameSpace



On Thu, 2005-05-12 at 19:42 +0530, Chetan Raj wrote:
> and I call hasAttributes as shown below on the document element
[...]
> The value of b obtained is FALSE.

If I'm not mistaken I would say this is a bug in gdome2. The problem
seems to be that the hasAttributes method is implemted by calling

	gdome_xmlGetAttrList

(gdome-xml-xmlutil.c:160) to test whether the node has any attribute
set, and this function looks into the "properties" field of the libxml2
node. However, libxml2 stores namespace declarations in a different
field named "nsDef", which is retrieved by 

	gdome_xmlGetNsDeclList

(gdome-xml-xmlutil.c:174). So, an apparently simple patch seems to check
in 

	gdome_xml_n_hasAttributes

(gdome-xml-node.c:1029) whether gdome_xml_n_hasAttributes returns a
non-NULL pointer. If Paolo agrees I can commit this patch.

Note that if you ask for the particular attribute "xmlns:abc" the
hasAttribute method returns true.

--luca

Attachment: signature.asc
Description: This is a digitally signed message part



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