RE: XInclude and xml:lang

David Lee <[email protected]>
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <220256FDE771B74FB662165BC562CF5946EAC0FC@CH1PRD0811MB418.namprd08.prod.outlook.com>
I think you are confusing the effect of xml:base and xml:lang with actual instances of the attribute.

The attributes xml:base and xml:lang do not get magically reproduced on all children,
thus your xpath is correctly not finding xml:lang on child elements where it was not explicitly added.

See: 
http://www.w3.org/TR/xml11/
Section 2.12
"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."


Like xml:base this puts the burden on the processor to implement the inheritance of the *property* specified by xml:lang ... but does not physically add new attributes in the XML.



----------------------------------------
David A. Lee
[email protected]
http://www.xmlsh.org


-----Original Message-----
From: polymorphisme [mailto:[email protected]] 
Sent: Wednesday, October 10, 2012 9:40 AM
To: [email protected]
Subject: RE: XInclude and xml:lang


I have not understand why I obtain <bar xml:base="file.xml" xml:lang=""/>,
like this :

<foo xml:lang="fr" xmlns:xi="http://www.w3.org/2001/XInclude">
  <bar xml:base="file.xml" xml:lang=""/>
 </foo> 

It's no very logic. 
For example, with XPath, //bar/xml:lang return something like this : ""; 
so what in fact, the langage's bar is "fr".

Why I haven't or can't obtain something like this :
<foo xml:lang="fr" xmlns:xi="http://www.w3.org/2001/XInclude">
  <bar xml:base="file.xml"/>
 </foo> 

or this :

<foo xml:lang="fr" xmlns:xi="http://www.w3.org/2001/XInclude">
  <bar xml:base="file.xml" xml:lang="fr"/>
 </foo> 

Thanks for your responce.



DALDEI wrote:
> 
> On which element did you get xml:lang=""
> 
> ----------------------------------------
> David A. Lee
> [email protected]
> http://www.xmlsh.org
> 
> 
> -----Original Message-----
> From: polymorphisme [mailto:[email protected]] 
> Sent: Tuesday, October 09, 2012 2:23 PM
> To: [email protected]
> Subject: XInclude and xml:lang
> 
> 
> My question is very simple.
> I have a main file : 
> <foo xml:lang="fr" xmlns:xi="http://www.w3.org/2001/XInclude">
>   <xi:include href="file.xml"/> 
> </foo> 
> 
> and the file.xml : <bar/>
> 
> When I do a test with the exemple sax.Writer, I obtain the attribut
> xml:lang="" ! 
> Why I can't obtain xml:lang="fr" ou nothing since I have foo xml:lang="fr"
> ?
> 
> sax.Writer -xi src/resources/xerces/xerces-xi.xml
> <foo xml:lang="fr" xmlns:xi="http://www.w3.org/2001/XInclude">
>   <bar xml:base="file.xml" xml:lang=""/>
>  </foo> 
> 
> Regard.
> -- 
> View this message in context:
> http://old.nabble.com/XInclude-and-xml%3Alang-tp34533941p34533941.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/XInclude-and-xml%3Alang-tp34533941p34537130.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.