[whatwg] Map lang to xml:lang at the parser level

Simon Pieters zcorpan at hotmail.com
Sun Oct 15 10:05:47 PDT 2006


When parsing HTML and serializing as XML you normally want to change the 
lang attribute to xml:lang. But why not put it in the XML namespace at the 
parser level? Then when you serialize the DOM as XML it becomes xml:lang 

The .lang DOM attribute would reflect xml:lang. This would make it simpler 
to set/get the language with script in XHTML (no need to use namespace-aware 

I don't know if this is too expensive on the parser or if there are other 
flaws but it's just an idea.

Simon Pieters

More information about the whatwg mailing list