Re: xml:lang in validator.nu parser

On 28.1.2013 22:40, Yves Savourel wrote:

> 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.

Hi Yves,

please note that validator.nu parser is *HTML* parser so it should be
used for parsing of content using HTML syntax. For XHTML you should use
normal XML parser. HTML syntax doesn't support namespaces (and thus it
doesn't support xml:lang) and xml:lang is treated as an attribute which
local name is "xml:lang". This can't be represented in XML data model
(":" can't be part of local name), so validator.nu parser is turning
this into "xmlU00003Alang" probably.

See relevant section in HTML spec:

http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-lang-and-xml:lang-attributes

    Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------

Received on Tuesday, 29 January 2013 16:48:30 UTC