Re: Fw: FYI .. New article for REVIEW: xml:lang in XML document schemas

Hi Sandy, hi all,


>> This could be of interest to our XML schema folks ..
>
> Schema (and XML Infoset) currently have no special treatment for  
> xml:lang:
> it's just a normal attribute and appear in the infoset in the same way as
> other attributes.

I guess the critical part of the article is:

"The xml:lang value applies to any sub-elements contained by the element.  
It also applies to attribute values associated with the element and  
sub-elements (though using natural language in attributes is not best  
practice). "

This could be changed to

"The xml:lang value can be interpreted as applying to any sub-elements  
contained by the element. It also can be interpreted as applying to  
attribute values associated with the element and sub-elements (though  
using natural language in attributes is not best practice). This  
interpretation is not provided by any XML data model (xml infoset, xml  
schema, XPath 2.0 data model), and it must be verified by additional  
processing. A facility for such processing might be the lang() function of  
XQuery/XSLT 2.0 [1], which uses the XPath expression  
(ancestor-or-self::*/@xml:lang)[last()] to gather language values from  
ancestor element nodes or the current element node."

This is quite lengthy, but would that address your concern about the topic?

Regards, Felix

[1] http://www.w3.org/TR/2005/WD-xpath-functions-20050404/#func-lang

>
> This article suggests that "xml:lang" should be used to specify the
> language in which the XML is written, while other language stuff should  
> be
> used as part of the value being transmitted.
>
> If the world adopts this suggestion, then a bunch of things could/should
> happen (to treat xml:lang specially, similar to the treatment to  
> namespace
> declarations):
> - Special treatment for xml:lang in infoset (some special property?)
> - Special validation rule for xml:lang in schema
> - Special treatment in data binding specs (to ignore xml:lang)
> - ...
>
> I don't think any of these will happy easily. For schema, we've been
> discussing treating all/some of xml: attribute specially. We are  
> currently
> leaning towards not to do that.
>
> This article also mentions about "inheriting xml:lang", which is somewhat
> misleading. The XML spec talks about that xml:lang's "intent is  
> considered
> to apply to the sub-tree". My reading of this is that xml:lang aware
> processor can use such info to do useful things. But that doesn't imply
> that xml:lang attribute is inherited by sub-elements in XML. The infoset
> spec certainly has no mention of inheriting any xml:lang related infoset
> property.
>
> Thanks,
> Sandy Gao
> XML Parser Development, IBM Canada
> (1-905) 413-3255
> sandygao@ca.ibm.com
>
>

Received on Friday, 19 August 2005 02:55:15 UTC