This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Re: Advantages of XInclude?
On Wed, Nov 13, 2002 at 10:33:16AM -0800, Bob Stayton wrote:
> On Wed, Nov 13, 2002 at 01:14:30PM -0500, Daniel Veillard wrote:
> > On Wed, Nov 13, 2002 at 09:34:17AM -0800, Bob Stayton wrote:
> > > > Right, XInclude requires the addition of xml:base at the inclusion
> > > > point (unless the document included and the main one share a base
> > > > which makes it unecessary, like if they are in the same directory).
> > > > I see no other way than adding xml:base to the DocBook DTD (which would
> > > > make sense to me but it's not my call.)
> > >
> > > I was going to suggest using an XML catalog to locate XIncludes,
> > > so that any xml:base could appear in the catalog file rather
> > > than the document.
> >
> > that won't do it. XInclude does not need xml:base in the input, it adds it
> > to the output. The goal is to keep all URI-References made from the included
> > parts correct. Basically if main.xml includes chap/chap1.xml and chap1.xml
> > references img1.jpg , the the presence of the xml:base added at the inclusion
> > point preserves the "img1.jpg" URI-Reference from the chapter included.
> > Explained formally at:
> > http://www.w3.org/TR/xinclude/#base
>
> OK, thanks for clarifying that.
There is a workaround for this xml:base validation problem,
until it can get put into the DocBook DTD.
Any including document could extend the DocBook DTD
in the internal subset to permit xml:base. There is
even a convenient parameter entity to do it:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % local.common.attrib "xml:base CDATA #IMPLIED">
]>
This permits the xml:base attribute in just about every
DocBook element. This extension would only have to be added
to those files that need it. That is, those files that
are going to submitted to validation, and which have
includes of files that are in a different directory from
the including document.
It would have to be removed when the standard DTD
is updated to support xml:base.
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com