W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [DOM4] XML lang

From: Marcos Caceres <w3c@marcosc.com>
Date: Wed, 5 Oct 2011 11:25:09 +0200
To: Robin Berjon <robin@berjon.com>
Cc: public-webapps <public-webapps@w3.org>
Message-ID: <7E4753EE766C45039D9CD0993C0E1BA1@marcosc.com>

On Wednesday, October 5, 2011 at 11:08 AM, Robin Berjon wrote:

> Unless you're dealing with documents of incredible depth, walking up the tree should really not be all that costly. What's more, since you're dealing with a tree that doesn't change, you can walk the tree once and precompute the language value for every element and cache it so that you only have to walk the tree once.
This is true for my case. 
> But even without that note, have you looked at using document.querySelectorAll("element:lang(en-us)")? It doesn't do exactly what you want, but it should provide a decent starting place. If you're using XPath instead, it has a lang() function that does more or less the same thing.
Yeah, I looked at document.querySelectorAll, which is what prompted me to write the email (I was trying to avoid using XPath:)). 
> Oh, and happy birthday!
Thanks! :D 
Received on Wednesday, 5 October 2011 09:25:41 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC