Re: Testing RFC 4646 values in markup languages

Le 17 mars 2008 à 17:52, Felix Sasaki a écrit :
>> In XML, it is a bit tricky, it seems. By XML spec
>
> why is it tricky?

mwarf. sent it too quick.

In Extensible Markup Language (XML) 1.0 (Fourth Edition), I read about  
[language identification][2],

	"A special attribute named xml:lang may be
	inserted in documents to specify the language
	used in the contents and attribute values of
	any element in an XML document. In valid
	documents, this attribute, like any other,
	MUST be declared if it is used."

Initially I thought that any vocabulary could have xml:lang anywhere  
but the rule seems to be a bit more refined.

1. It can be on any elements.
2. For documents meant to be validated, it MUST be declared (schemas,  
dtd?)

I see later on in Attribute-list declaration:

	"At user option, an XML processor MAY issue
	a warning if attributes are declared for an
	element type not itself declared, but this
	is not an error. The Name in the AttDef rule
	is the name of the attribute."

in HTML 5 spec the xml:lang is [defined][4] by 3.4.3. The lang (HTML  
only) and xml:lang (XML only) attributes

	"The xml:lang  attribute is defined in XML. [XML]"

It is part of the global attributes definition

	"The following attributes are common to and may
	be specified on all HTML elements (even those
	not defined in this specification):"


which is not following what HTML 4.01 was doing before.

	lang     on All elements but APPLET, BASE,
	BASEFONT, BR, FRAME, FRAMESET, IFRAME, PARAM, SCRIPT


html5 served as application/xhtml+xml

<html xmlns="http://www.w3.org/1999/xhtml">
  <head> <title>example of xhtml</title> </head>
  <body>
	<p>foo <br xml:lang="en"/> bar</p>
  </body>
</html>


What a Conformance checker should do here?







[1]: http://www.w3.org/TR/2006/REC-xml-20060816/
[2]: http://www.w3.org/TR/2006/REC-xml-20060816/#sec-lang-tag
[3]: http://www.w3.org/TR/2006/REC-xml-20060816/#dt-attdecl
[4]: http://www.w3.org/TR/html5/#the-lang

--
Karl Dubost - W3C
http://www.w3.org/QA/
Be Strict To Be Cool

Received on Tuesday, 18 March 2008 02:01:29 UTC