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] Including external XSL-FO in docbook document ?


There are two mechanisms for combining documents in such a way: XInclude and
the document() function in XSLT.

Using XInclude, you could have your DocBook as follows:

<book>
 <title>..</title>
 <chapter>..</chapter>
 <chapter>..</chapter>
 <chapter>..</chapter>
 <chapter>..</chapter>
 <appendix>
  <title>Resume</title>
  <xi:include xmlns:xi="official-xinclude-uri" href="resume.xml"/>
 </appendix>
</book>

You then write a customization layer that imports both the DocBook and
ResumeXML stylesheets.  You then only need to be sure that your resume
doesn't create anything that can't occur within an <fo:flow/> element.  (It
may be easier *not* to put the XInclude element inside of an appendix, and
allow your Resume to generate the fo:page-sequence and below.  You just need
to be sure that your resume uses a page-sequence-master that is declared.

The approach using the document() function would be similar, but you would
need logic to determine where to insert the contents of the resume.  If you
just want to add the resume at the end of a "book" (similar for article),
you could use the following:

<xsl:template match="book">
 <xsl:apply-imports/>
 <xsl:apply-templates select="document('resume.xml')"/>
</xsl:template>

and make sure that the template that matches the top-level resume element
only creates the <fo:page-sequence/> and below.

Jeff Beal

> -----Original Message-----
> From: Marc Baaden [mailto:baaden@smplinux.de]
> Sent: Wednesday, September 10, 2003 9:26 AM
> To: Bob Stayton
> Cc: docbook-apps@lists.oasis-open.org
> Subject: Re: [docbook-apps] Including external XSL-FO in docbook
> document ? 
> 
> 
> 
> I think I need to give more details:
> I have the sources of both documents (as written by me).
> One is a report in docbook, the other a resume using a
> modified xmlresume DTD.
> 
> I need to include the resume in the docbook report.
> So these are not two docbook documents two combine,
> but docbook + another DTD.
> 
> As both are using different DTDs, I couldn't think of a
> way to generate "one" document from a unified XML source.
> 
> That's why I thought about merging the fo files or the final
> PDF files.
> 
> Does that help ?
> 
> Marc
> 
> >>> Bob Stayton said:
>  >> > as I am currently working on a report mainly written in docbook,
>  >> > I have the following problem: I need to include a 
> couple of pages
>  >> > that are produced from another xml source via xslt and xsl-fo.
>  >> > 
>  >> > In the end I want to produce a PDF document. So I could do
>  >> > docbook -> PDF
>  >> > OtherSource -> PDF
>  >> > Combine both PDFs as desired
>  >> > 
>  >> > *but* .. I'd at least need to tell docbook about the 
> inserted pages,
>  >> > for correct page numbering etc., how to do that ?
>  >> > 
>  >> > Also, this procedure is not much streamlined.
>  >> > Given that the other document source produces 
> Formatting Objects,
>  >> > I wonder whether I could somehow combine the docbook FO with the
>  >> > other FO ?
>  >> 
>  >> Is there any way you can get your hands on a copy
>  >> of the DocBook XML source for this material?
>  >> 
>  >> Merging PDF is not something I'd want to try, that is,
>  >> if I wanted a working PDF file.  8^)
>  >> 
>  >> Merging FO is somewhat possible, at page-sequence
>  >> boundaries.  But with what results?
>  >> Your table of contents or index won't cover the inserted
>  >> material, unless you do some real FO magic.
>  >> 
>  >> How much easier it would be to insert a copy of the DocBook
>  >> source into your source and build a real book.
>  >> If you could get the FO, why couldn't you get the XML?
>  >> Not that I doubt there are procedures for such things,
>  >> but sometimes they get in the way.
>  >> 
>  >> -- 
>  >> 
>  >> 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
>  >> 
> 
> Marc Baaden
> 
> -- 
>  Dr. Marc Baaden  - Institut de Biologie Physico-Chimique, Paris
>  mailto:baaden@smplinux.de      -      http://www.marc-baaden.de
>  FAX: +49 697912 39550  -  Tel: +33 15841 5176 ou +33 609 843217
> 
> 
> 
> To unsubscribe from this list, send a post to 
> docbook-apps-unsubscribe@lists.oasis-open.org.
> 
> 
> 


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