- From: Adrian Bateman <adrianba@microsoft.com>
- Date: Sun, 18 Oct 2009 15:30:06 +0000
- To: Jonas Sicking <jonas@sicking.cc>, Tony Ross <tross@microsoft.com>
- CC: "public-html@w3.org" <public-html@w3.org>
On Saturday, October 17, 2009 11:34 PM, Jonas Sicking wrote:
> On Sat, Oct 17, 2009 at 4:54 PM, Tony Ross <tross@microsoft.com> wrote:
> > Another use case would be the ability to easily and
> > efficiently select the list of all elements in the document that the
> > library should act upon.
>
[snip]
>
> Not sure I understand the list-of-elements example.
The scenario is that a library wants to process all elements in its namespace. From Tony's document:
---
Querying for elements specific to a particular extension becomes cleaner.
var myCustomElements =
document.getElementsByTagNameNS("com.mycompany", "*");
Without mapping to namespaces, some form of filtering must be performed by script.
var elms = document.getElementsByTagName("*");
for(var i = 0; i < elms.length; i++)
{
if(elms[i].tagName.indexOf("my:") == 0)
{
// Do some work
}
}
---
Received on Sunday, 18 October 2009 15:32:26 UTC