Re: XInclude language fixup

Thomas Passin <[email protected]> Sat, 11 Feb 2023 13:37:07 -0500
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
You are not the first spec writer that thought he wrote a section to 
mean one thing but later found he had to interpret the language a 
different way!

On 2/11/2023 12:56 PM, Norm Tovey-Walsh wrote:
> Hello world,
> 
> Following up on a bug report (only tangentially related), I find myself
> reading https://www.w3.org/TR/xinclude-11/#language again and I’m having
> trouble working out what’s intended (yes, I know I was the editor for
> 1.1, but it was a long time ago and it’s remarkable how much
> specification prose that is “obvious” when you write it and review it
> can lose its obviousness over time).
> 
> In particular, I’m trying to work out if/when the value of xml:lang is
> the empty string.
> 
> Suppose I have:
> 
> <doc xmlns:xi="http://www.w3.org/2001/XInclude"
>       xml:lang="en">
>    <xi:include href="en.xml" fragid="element(/1/1)"/>
>    <xi:include href="de.xml" fragid="element(/1/1)"/>
>    <xi:include href="xx.xml" fragid="element(/1/1)"/>
> </doc>
> 
> where en.xml is:
> 
>    <chap xml:lang="en"><p>English</p></chap>
> 
> de.xml is:
> 
>    <chap xml:lang="de"><p>Deutsch</p></chap>
> 
> and xx.xml is:
> 
>    <chap><p>Something</p></chap>
> 
> After XInclude processing, if xml:lang fixup is performed, the first two
> paragraphs are obvious, I think:
> 
> <doc xmlns:xi="http://www.w3.org/2001/XInclude"
>       xml:lang="en">
>    <p>English</p>
>    <p xml:lang="de">Deutsch</p>
>    …
> </doc>
> 
> But what about the third? I can’t decide if 4.7.6 says it should be
> 
>    <p xml:lang="">Something</p>
> 
> or if 4.7.6. only admits the possibility that I might have specified
> <chap xml:lang="sp"><p xml:lang="">Something</p></chap> to reset
> the paragraph to, I guess, the “default” value.
> 
> My XInclude processor currently produces
> 
> <doc xmlns:xi="http://www.w3.org/2001/XInclude"
>       xml:lang="en">
>    <p xml:lang="en">English</p>
>    <p xml:lang="de">Deutsch</p>
>    <p>Something</p>
> </doc>
> 
> I’m not too worried about the redundant xml:lang on first paragraph, it
> seems harmless. But should I put xml:lang="" on the last paragraph?
> 
> I think the answer is “yes” but I wonder if anyone else feels strongly
> that I’m wrong.
> 
> FWIW, I’m also confused about the last paragraph in that section:
> 
>    If an xml:lang attribute information item is already present, it is
>    replaced by the new attribute.
> 
> How is that ever going to happen? I think that’s just…incoherent.
> 
>                                          Be seeing you,
>                                            norm
> 
> --
> Norman Tovey-Walsh <[email protected]>
> https://nwalsh.com/
> 
>> Change is a dangerous game, but one you have to play.


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: [email protected]
subscribe: [email protected]
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php