Newsgroups: netscape.public.mozilla.jseng
From: Martin Honnen <mahotr...@yahoo.de>
Date: Fri, 08 Apr 2005 18:59:10 +0200
Local: Fri, Apr 8 2005 12:59 pm
Subject: E4X: should xmlObject.attributes() return all attributes or only those in no namespace?
Test case: var p = <p id="p1" class="style1" xml:lang="en">Kibology for all.</p>; yields 2 with Spidermonkey and 3 with Rhino. The specs says "The attributes method returns an XMLList containing the The only way to consistently get all attributes with Rhino and -- Martin Honnen You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Fri, 08 Apr 2005 15:21:35 -0700
Local: Fri, Apr 8 2005 6:21 pm
Subject: Re: E4X: should xmlObject.attributes() return all attributes or only those in no namespace?
Martin Honnen wrote: Here is where the nice prose with examples added to aid understanding in > Test case: > var p = <p id="p1" class="style1" xml:lang="en">Kibology for all.</p>; > yields 2 with Spidermonkey and 3 with Rhino. > The specs says "The attributes method returns an XMLList containing the ECMA-357, missing from ECMA-262, can be a hazard. This is not a rigorous definition, and in fact it's either misleading, or the algorithm in the spec is buggy. > Return the result of calling the [[Get]] method of x with argument That's correct. From 13.4.4.5, see 10.5, then see 10.5.1, then see > 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. 13.2.2 2(b) in particular. The resulting AttributeName used to match attributes has a [[Name]] internal property that's a QName with uri === "" and localName === "*". That will not match all attributes. It will match only attributes in > Is that a bug in the spec? If there is a method called attributes why It may be a bug in the spec, because ToAttributeName("*") does something > does it not return all attributes regardless of whether they are in a > namespace or not? different from new QName("*"). The latter results in a name whose uri === null, which would match any attribute, no matter what namespace it is in. > The only way to consistently get all attributes with Rhino and Bcc'ing once again some folks who might be able to do something about > 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. the spec. /be You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Fri, 08 Apr 2005 15:29:29 -0700
Local: Fri, Apr 8 2005 6:29 pm
Subject: Re: E4X: should xmlObject.attributes() return all attributes or only those in no namespace?
Brendan Eich wrote: Strike the "by default" -- unprefixed attributes are in the null > That will not match all attributes. It will match only attributes in > the null namespace (or in no namespace, another way of saying the same > thing), which unprefixed attributes go in by default (even if there's a > default namespace declared for the containing tag). namespace, period -- whether there is a declared default xmlns= or not. /be You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |