W3C home > Mailing lists > Public > public-webapi@w3.org > May 2007

Re: Comments on element traversal specification...

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 22 May 2007 20:21:15 -0700
Message-ID: <4653B32B.5020009@sicking.cc>
To: liorean <liorean@gmail.com>
CC: public-webapi@w3.org

liorean wrote:
>> For my purposes, if the application is processing element content, it
>> needs to raise an error if non-whitespace text is found.  If it is
>> processing mixed content, it needs to pass the skipped content back to
>> the caller. I cannot think of the case where non-whitespace text
>> should ever be silently ignored.
> 
> I can see many uses. Script tree transformations, overlays, most
> client side manipulation, if you want to write your own Selectors API
> for kicks, there are many cases where you are only interested in the
> elements tree.

I don't think implementing things "for kicks" is a useful use case. In 
general adding spec features to allow other specs to build on top of 
that is a bad idea IMHO, I basically never use other public APIs when 
implementing features, instead I use internal APIs that are better fit 
for my needs.

In any case, using element traversal you can decently easy check if 
content is skipped so that you can indicate an error, simply check if 
myElem.nextElementSibling != myElem.nextSibling

/ Jonas
Received on Wednesday, 23 May 2007 03:24:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:57 GMT