This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] XInclude: multiple <preface>s
- From: Bob Stayton <bobs at sco dot com>
- To: Daniel Veillard <veillard at redhat dot com>
- Cc: Michael Wiedmann <mw at miwie dot in-berlin dot de>,DocBook-Apps ML <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 31 Mar 2003 13:50:41 -0800
- Subject: Re: [docbook-apps] XInclude: multiple <preface>s
- References: <20030331200643.GA7423@miwie.in-berlin.de> <20030331160443.C31240@redhat.com>
On Mon, Mar 31, 2003 at 04:04:43PM -0500, Daniel Veillard wrote:
> On Mon, Mar 31, 2003 at 10:06:43PM +0200, Michael Wiedmann wrote:
> > I try to separate a large <book> into smaller XML file using XInclude.
> > That works of course in general but how do I put several <prefaces>s
> > into a separate XML file and XInclude it?
> [...]
> > If 'preface.xml' contains more than one <preface> (which is IMHO valid
> > DocBook), then
> >
> > $ xmllint -xmllint book-master.xml > book.xml
> >
> > complains like:
> >
> > preface.xml:76: error: Extra content at the end of the document
> > <preface id="download">
> > ^
> > XInclude: could not load preface.xml, and no fallback was found
>
> preface.xml is not an XML document.
>
> > Any workaround?
>
> The XIncluded parts must be well formed XML documents. That's
> completely indepedant of the DocBook syntax, you don't have the
> right to put multiple roots in an XML document, be it XIncluded or not.
Slight correction. The document being pointed to must be
well formed, but the parts being included do not.
With a little creativity, you can work around this problem.
Your preface document can be a <book> element that contains
multiple prefaces. If your XInclude resolver handles
basic XPointer syntax (like xsltproc does), then you can
pull in the set of prefaces without the book element:
<xi:include href="preface.xml#xpointer(/book/preface)"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
--
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 at sco dot com
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org