sunitha nair <[EMAIL PROTECTED]> wrote
> In the commandline i'm using
> java -cp org.apache.fop.apps.Fop -xsl rajeev.xsl -xml
> rajeev.xml -pdf rajeev.pdf
> 
> that is rajeev.xml is the final xml file which contain
> 
> lot of chapter xml files.I need chapter files because
> i want to make pdf of individual chapter other than
> pdf of entire book as user demands.
> so my question is how i combine all that chapter files
> into a single xml file so that i can use the above
> command line and make the book pdf.
> as per the above commandline i'm inputting .xml and
> .xsl(eventhough using the xsl-fo tags).
> how i make pdf of a book ,if there are two chapter xml
> files...chapter1.xml & chapter2.xml using fop with the

There are several posibilities. A pure XSLT solution would
be to create a control file "rajeev.xml"

<?xml version="1.0">
<files>
  <file>chapter1.xml</file>
  <file>chapter2.xml</file>
</files>

then set up your XSL file rajeev.xsl roughly as follows:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:fo="http://www.w3.org/1999/XSL/Format";>

 <xsl:template match="files>
   <fo:root>
     <!-- setup your page masters, page-sequence, static content
         etc. here -->
     <fo:flow>
       <!-- get the content now -->
       <xsl:apply-templates select="document(file,'.')"/>
     </fo:flow>
  </fo:root>
 </xsl:template>
 <!-- templates from your XSL here -->
</xsl:stylesheet>
then invoke FOP as you wrote in your mail.

This will put all your chapters in the same flow, if you want
to put chapter dependant info in the static content, you'll
have to fiddle with it a bit. The core is the "document(file,'.')"
part, which will pull in all the files named in your control file.
Get more infos about it from any XSL book, the XSLT-FAQ
http://www.dpawson.co.uk/xsl/ or the XSLT spec
http://www.w3.org/TR/xslt
If you have difficulties adapting the example code to your needs
ou'll have to ask on the XSL list as this are not FO questions.

> same .xsl file for styling.
I don't quite understand this. You don't have individual XSL files
for each chapter, do you?

HTH
J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to