[Bug 16166] i18n-ISSUE-138: Make lang and xml:lang synonyms in HTML5

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16166

--- Comment #7 from I18n Core WG <public-i18n-core@w3.org> 2012-03-23 17:09:39 UTC ---
(In reply to comment #5)
> In my reading, you are mistaken about XSLT: There is no purpose for xml:lang,
> from XSLT's point of view, except when the XHTML document is supposed to be
> post-processed with XSLT. How often is that?

Well, quite often in my case, and that of others I know. 

For example, when i18n WG writes WG Notes you don't add numbering for headers
or examples or figures, nor do you, say, add the title of a figure to the link
text while editing the document (in XHTML syntax). You run an XSLT script just
before publication that adds all of those things automatically. It saves a huge
amount of time while editing and especially makes life easier when things
change a lot in early drafts.

Another example: the cascading choices of the techniques indexes we have on the
W3C i18n site are generated automatically at run-time from browsable pages
(with XHTML 1.0 syntax). This means that I don't need to make changes in two
places when I change the order or titles of the information. To read in the
data I use simpleXML in PHP.

Also, I have a lot of AJAX functionality on many of my apps that often extracts
data from a section of a browser-ready page, and because I'm using XHTML 1.0
file I processes it as an XML object.

It's because I often want to process the pages as XML data (pages that in other
contexts are just served to a browser) that I use XHTML 1.0 (and want to use
Polyglot in future) for my pages.

The use of xml:lang is not relevant to how the XSLT syntax itself uses language
attributes, it's about the fact that if I want to detect the language of the
data i'm reading while processing it as XML, then I rely on the xml:lang
attribute because it's meaning as an inheritable language declaration is
defined in the XML spec. So, for example, XPath has a lang() function that
tests whether the language of a given node, *as defined by the xml:lang
attribute*, corresponds to the language supplied as an argument.  This function
does not work on a lang attribute in the data being read.

So, basically, any time I write source code for a browser that i may want to
parse also using an XML processor, I need to use the xml:lang attribute as well
as the lang attribute.  (If you aren't going to process polyglot documents as
XML, I'm not sure why you'd want to go to the trouble of making them polyglot.)

In my view, xml:lang is therefore not optional for polyglot documents if you
want to process the same data using a 'generic' XML processor and want to
detect language information.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 23 March 2012 17:09:45 UTC