OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] XInclude: multiple <preface>s


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@sco.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]