W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] getElementsByIdPart

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 29 Aug 2004 17:46:15 +0000 (UTC)
Message-ID: <Pine.LNX.4.61.0408291742170.8458@dhalsim.dreamhost.com>
On Thu, 26 Aug 2004 chriswa at comcast.net wrote:
> 
> What I'm looking for is a way to apply a regular expression that can 
> return matched elements.  What I am doing is taking advantage of the way 
> ASP.NET generates id names and use javascript to group them together as 
> structures.

I see you got the XPath solution working.

You should also be able to use DOM2 Traversal to obtain the results you 
are looking for, although IE does not support this.

   http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Iterator-overview

I am reluctant to add a getElementsByIdPart() method to the DOM since it 
would be primarily to address this single use case, and is of dubious 
semantic value (IDs are generally thought of as opaque, not as 
hierarchical strings).

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 29 August 2004 10:46:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:36 UTC