Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

HasAttributes - NameSpace: msg#00006

Subject: HasAttributes - NameSpace
Hi All,

I have ran into an another problem with namespaces while using gdome!

If I parse an existing xml document with only namespace attribute in the document element, and then call 'hasAttributes' on the document element, the 'hasAttributes' returns false.

Namespaces are special attirbutes and should be ideally considered as attributes itself. So 'hasAttributes' should have returned true.

If it is a conscious decision to support this behaviour, why was it designed that way?

The following code snippets will demonstrate the problem

consider "college.xml" having the following data...

<
abc:college xmlns:abc ="namespaceUri">
       <abc:principal>ram</ abc:principal>
</abc:college >

and I call hasAttributes as shown below on the document element

    GdomeException exc = 0;
    GdomeDOMImplementation *domimpl = gdome_di_mkref ();

    GdomeDocument *doc = gdome_di_createDocFromURI(domimpl,"college.xml",GDOME_LOAD_PARSING,&exc);
    GdomeElement* elem = gdome_doc_documentElement(doc,&exc);
    GdomeBoolean b = gdome_el_hasAttributes(elem,&exc);

The value of b obtained is FALSE.


Thanks,
Chetan Raj
_______________________________________________
gdome mailing list
gdome@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gdome
<Prev in Thread] Current Thread [Next in Thread>