Re: xml:lang in validator.nu parser

Hi Yves, all,


Am 28.01.13 22:40, schrieb Yves Savourel:
> Hi all,
>
> This is a bit off topic, but since several of us are using the validator.nu parser for HTML5, maybe someone has already run into this question:
>
> I'm trying to implement the xml:lang precedence over lang in XHTML but I have a strange xml:lang attribute in the parsed elements.
>
> I have this input:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>   http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head><title>title</title>
> </head>
> <body>
> <p lang='es' xml:lang='pt'>t1</p>
> </body></html>
>
> and when I try to look up the xmlLang attribute for p with getAttributeNodeNS(XML_NS_URI, "lang") I get null.

Maybe you have to set mappingLangToXmlLang
http://about.validator.nu/htmlparser/apidocs/src-html/nu/validator/htmlparser/impl/Tokenizer.html#line.577
to "false" then calling the parser.
I haven't tried this out, so just an idea.

Best,

Felix
> I've looked at the parsed attributes and it looks like this:
>
> [lang="es", xmlU00003Alang="pt"]
>
> For some reason xml:lang is represented as 'xmlU00003Alang' (with a null namespace).
>
> So, sure, I can access it and work, but this looks really wrong to me. Any of you ran into the same issue and has a clue why this happens?
>
> cheers,
> -yves
>
>
>

Received on Tuesday, 29 January 2013 07:36:22 UTC