Language fixup and the expected results of test eduni-3

So.

Given lang.xml:

<sentences xmlns:xi="http://www.w3.org/2001/XInclude">
  <sentence>The cat sat on the mat.</sentence>
  <sentence xml:lang="en-gb">Jackdaws love my big sphinx of quartz.</sentence>
  <xi:include href="lang-samples.xml" xpointer="none"/>
  <xi:include href="lang-samples.xml" xpointer="none2"/>
  <xi:include href="lang-samples.xml" xpointer="english"/>
  <xi:include href="lang-samples.xml" xpointer="english2"/>
  <xi:include href="lang-samples.xml" xpointer="french"/>
  <xi:include href="lang-samples.xml" xpointer="german"/>
  <xi:include href="lang-samples.xml" xpointer="australian"/>
  <sentences xml:lang="en-gb">
    <xi:include href="lang-samples.xml" xpointer="none"/>
    <xi:include href="lang-samples.xml" xpointer="none2"/>
    <xi:include href="lang-samples.xml" xpointer="english"/>
    <xi:include href="lang-samples.xml" xpointer="english2"/>
    <xi:include href="lang-samples.xml" xpointer="french"/>
    <xi:include href="lang-samples.xml" xpointer="german"/>
    <xi:include href="lang-samples.xml" xpointer="australian"/>
  </sentences>
</sentences>

and lang-samples.xml:

<sentences>
 <sentence xml:id="none">Hi.</sentence>
 <sentence xml:id="english" xml:lang="en-gb">Hello.</sentence>
 <sentence xml:id="french" xml:lang="fr">Bonjour.</sentence>
 <sentences xml:lang="en-gb">
   <sentence xml:id="english2">Hello.</sentence>
 </sentences>
 <sentences xml:lang="de">
   <sentence xml:id="german">Guten Tag.</sentence>
   <sentences xml:lang="en-au">
     <sentence xml:id="australian">G'day mate.</sentence>
   </sentences>
   <sentences xml:lang="">
     <sentence xml:id="none2">Yo..</sentence>
   </sentences>
 </sentences>
</sentences>

The proposed expected results are:

<sentences xmlns:xi="http://www.w3.org/2001/XInclude">
  <sentence>The cat sat on the mat.</sentence>
  <sentence xml:lang="en-gb">Jackdaws love my big sphinx of quartz.</sentence>
  <sentence xml:id="none" xml:base="lang-samples.xml">Hi.</sentence>
  <sentence xml:id="none2" xml:base="lang-samples.xml">Yo..</sentence>
  <sentence xml:lang="en-gb" xml:id="english" xml:base="lang-samples.xml">Hello.</sentence>
  <sentence xml:lang="en-gb" xml:id="english2" xml:base="lang-samples.xml">Hello.</sentence>
  <sentence xml:lang="fr" xml:id="french" xml:base="lang-samples.xml">Bonjour.</sentence>
  <sentence xml:lang="de" xml:id="german" xml:base="lang-samples.xml">Guten Tag.</sentence>
  <sentence xml:lang="en-au" xml:id="australian" xml:base="lang-samples.xml">G'day mate.</sentence>
  <sentences xml:lang="en-gb">
    <sentence xml:lang="" xml:id="none" xml:base="lang-samples.xml">Hi.</sentence>
    <sentence xml:lang="" xml:id="none2" xml:base="lang-samples.xml">Yo..</sentence>
    <sentence xml:lang="en-gb" xml:id="english" xml:base="lang-samples.xml">Hello.</sentence>
    <sentence xml:id="english2" xml:base="lang-samples.xml">Hello.</sentence>
    <sentence xml:lang="fr" xml:id="french" xml:base="lang-samples.xml">Bonjour.</sentence>
    <sentence xml:lang="de" xml:id="german" xml:base="lang-samples.xml">Guten Tag.</sentence>
    <sentence xml:lang="en-au" xml:id="australian" xml:base="lang-samples.xml">G'day mate.</sentence>
  </sentences>
</sentences>

I don’t understand why xml:lang="en-gb" is expected on line 14. AFAICT, the in-scope
language on the XInclude element is already en-gb so fixup isn’t required.

That lead me to read section 4.7.6 again. I don’t see any reason why
that xml:lang attribute is required, but I could have misunderstood
something.

On an unrelated note, I do find the last sentence before the closing
note confusing:

  If an xml:lang attribute information item is already present, it is
  replaced by the new attribute.

If you’re XInclude an element with an xml:lang attrbute, why is
language fixup replacing it?

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 512 761 6676
www.marklogic.com

Received on Saturday, 16 April 2016 16:46:37 UTC