Subj : E4X: should xmlObject.attributes() return all attributes or only To : netscape.public.mozilla.jseng From : Martin Honnen Date : Fri Apr 08 2005 07:59 pm Test case: var p =
Kibology for all.
; print("attributes().length(): " + p.attributes().length()); yields 2 with Spidermonkey and 3 with Rhino. The specs says "The attributes method returns an XMLList containing the XML attributes of this object." which lets me expect I get all attributes. However the formal definition then says Return the result of calling the [[Get]] method of x with argument ToAttributeName("*") and trying to read through the specification to understand what that should return it appears that only the attributes in no namespace are to be returned. Is that a bug in the spec? If there is a method called attributes why does it not return all attributes regardless of whether they are in a namespace or not? The only way to consistently get all attributes with Rhino and Spidermonkey is print("p.@*::*.length(): " + p.@*::*.length()); but it seems odd that the method attributes does not yield all attributes. If that is intended then the spec should maybe be fixed to specificially state that the method attributes only returns attributes in no namespace. -- Martin Honnen http://JavaScript.FAQTs.com/ .