Hi Richard,
I still do not agree, pls. see below:
Richard Tobin wrote:
>>> [...] the point I was trying to
>>> make was that the "Base URI Fixup" (http://www.w3.org/TR/xinclude/#base)
>>> should also work for parts of documents.
>>>
>> Bare fragments in the result of XInclude processing will be references
>> to the result document.
I do not agree as:
"""
Thus relative URI references in the included infoset resolve to the same
URI despite being included into a document with a potentially different
base URI in effect. |xml:base| attributes are added to the result
infoset to indicate this fact.
""" (http://www.w3.org/TR/xinclude/#base)
>> Both RFC2396 and RFC 3986 say that bare
>> fragments are same-document references, and XML Base can't change
>> that, nor can XInclude fix it up,
I think it can cf.: RFC 2396 section 5.1. Establishing a Base URI which
says that
"""
The order of precedence can be
thought of in terms of layers, where the innermost defined base URI
has the highest precedence.
"""
and section 5.1.1. Base URI within Document Content.
"""
[...]
the base URI of the document can
be embedded within the content itself such that it can be readily
obtained by a parser.
"""
>> since it doesn't know which
>> attributes are links.
It doesn't have to as it only needs to incorporate
xml:base="original-uri" to the new document and uris such as "" and
"#..." are interpreted in the light of the added xml:base="original-uri".
Some more updates to the example:
chap01.xml:
<book xmlns="http://docbook.org/docbook-ng" version="ipa">
<title id="c1-top">My Book</title>
<chapter id="c1-start" version="ipa">
<title>My Chapter</title>
<para>This is my chapter.</para>
<mediaobject>
<imageobject>
<imagedata fileref="picture.png"/>
</imageobject>
</mediaobject>
<ulink uri="#c1-top">Included from here</ulink>
<ulink uri="">Source File</ulink>
<ulink uri="#">Source File</ulink>
</chapter>
</book>
<book xmlns="http://docbook.org/docbook-ng"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="ipa">
<title id="b-top">My Book</title>
<xi:include href="chapters/chap01.xml" xpointer="c1-start"/>
</book>
<book xmlns="http://docbook.org/docbook-ng"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="ipa">
<title id="b-top">My Book</title>
<chapter xmlns="http://docbook.org/docbook-ng"
version="ipa"
xml:base="chapters/chap01.xml">
<title>My Chapter</title>
<para>This is my chapter.</para>
<mediaobject>
<imageobject>
<imagedata fileref="picture.png"/>
</imageobject>
</mediaobject>
<ulink uri="#c1-top">Included from here</ulink>
<ulink uri="">Source File</ulink>
<ulink uri="#">Source File</ulink>
</chapter>
</book>
--
Konrad Lanz, IAIK/SIC - Graz University of Technology
Inffeldgasse 16a, 8010 Graz, Austria
Tel: +43 316 873 5547
Fax: +43 316 873 5520
https://www.iaik.tugraz.at/aboutus/people/lanzhttp://jce.iaik.tugraz.at
Certificate chain (including the EuroPKI root certificate):
https://europki.iaik.at/ca/europki-at/cert_download.htm