After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 129965 - xinclude 2003, missed xml:base
xinclude 2003, missed xml:base
Status: VERIFIED NOTABUG
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2003-12-24 20:12 UTC by Oleg Paraschenko
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Oleg Paraschenko 2003-12-24 20:12:55 UTC
Code is from CVS, dated by 24 Devember 2003.

Source XML:

----- <document.xml>
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2003/XInclude">
  <p>120 Mz is adequate for an average home user.</p>
  <xi:include href="disclaimer.xml"/>
</document>
----- </document.xml>

----- <disclaimer.xml>
<?xml version='1.0'?>
<disclaimer>
  <p>The opinions represented herein represent those of the individual
  and should not be interpreted as official policy endorsed by this
  organization.</p>
</disclaimer>
----- </disclaimer.xml>

After processing XIncludes:

----- <result>
<?xml version="1.0"?>
<document xmlns:xi="http://www.w3.org/2003/XInclude">
  <p>120 Mz is adequate for an average home user.</p>
  <disclaimer>
  <p>The opinions represented herein represent those of the individual
  and should not be interpreted as official policy endorsed by this
  organization.</p>
</disclaimer>
</document>
----- </result>

but

----- <expected>
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2003/XInclude">
  <p>120 Mz is adequate for an average home user.</p>
  <disclaimer xml:base="http://www.example.org/disclaimer.xml">
  <p>The opinions represented herein represent those of the individual
  and should not be interpreted as official policy endorsed by this
  organization.</p>
</disclaimer>
</document>
----- </expected>

It is expected that element "disclaimer" gets attribute "xsl:base", but it
is not so.
Comment 1 William M. Brack 2003-12-27 08:36:26 UTC
The output of xml:base only takes place if the base URI of the 
included infoset is different than the URI of the document into 
which it is being included.  In your example, if you move 
disclaimer.xml to a different directory (and, of course, change the 
href in document.xml) it should behave as you expect.  I believe 
this in in accordance with 4.5.5 of the specification.

Bill
Comment 2 Oleg Paraschenko 2003-12-27 12:51:26 UTC
> included infoset is different than the URI of the document 

It is exactly so. According to my understanding of the standard, base
URI of document is "document.xml" and base URI of acquired infoset is
"disclaimer.xml". So "xml:base" should appear, because base URI have
no any relations to directories, at least in XInclude standard.

I'm not re-opening due to going unsure. I have to consult with others.

By the way, this test case is an example 'C-1' from XInclude
specification.

Comment 3 Daniel Veillard 2003-12-29 23:00:46 UTC
The base is not the same, but when building an URI Reference 
they will lead to the same resulting URL, so adding an xml:base 
(not xsl:base !) is not needed in practice, 

  that's my understanding of both that example and of the spec...

Daniel
Comment 4 Oleg Paraschenko 2004-01-03 15:02:40 UTC
Looking at www-xml-xinclude-comments archives, I found a similar question:

http://lists.w3.org/Archives/Public/www-xml-xinclude-comments/2003Jun/0029.html
<quote>
In your provided correct result, is the xml:base attribute on the second
<root> element strictly necessary, since inc1.xml is in the same directory
as test.xml?
</quote>

And answer similar to Daniel's comment:

http://lists.w3.org/Archives/Public/www-xml-xinclude-comments/2003Jun/0030.html
<quote>
We're still pursing that question the WG.  Strictly speaking, the base
URI of the document is presumably something like
file:///d:XMLBaseTest/main.xml.  This is not character-for-character
equivalent, and the spec says an xml:base attribute is added if the two
values are "different".  If we clarify "different" to mean "not
equivalent for purposes of absolutization according to RFC 2396",
</quote>

With this clarification of "different", dropping of "xml:base" in this
issue is fully correct and bug 129965 is really NOTABUG.

Closing.