RE: Multiple XMLs to One PDF.

David,

Thanks for your prompt response.  I think its pretty interesting solution
but I am still confused on few things:

Lets assume I have something like this:

1. I have 3 XML files: a.xml, b.xml and c.xml
2. I have 3 different XSLs that I want to use for each XML: a.xsl, b.xsl,
and c.xsl.

Now from your solution I need to create either an XML String or a temp XML
file that will look something like
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <chapter href="a.xml"/>
  <chapter href="b.xml"/>
  <chapter href="c.xml"/>
</root>

Now I am not sure where would I put that document code and specify which xsl
to use for which xml?

Thanks in advance for all your help.

Viral.


-----Original Message-----
From: David Carlisle [mailto:davidc@nag.co.uk]
Sent: Friday, March 12, 2004 8:36 AM
To: viral.patel@countryfinancial.com
Cc: www-xsl-fo@w3.org
Subject: Re: Multiple XMLs to One PDF.



the document() function allows your xsl stylesheet to use any number of
xml source documents.
if for example your top level file was elements such as

 <chapter href="a.xml"/>
 <chapter href="b.xml"/>
 <chapter href="c.xml"/>
...

where the files a.xml, b.xml ... contained the source of the chapters then
a template like

<xsl:template match="chapter">
 <xsl:apply-templates match="document(@href)"/>
</xsl:template>

will cause the referenced files to be loaded and transformed.
So you end uo with one FO file representing the combined document, which
you then process as usual.

> then re-using it and appending the rest of the XML files to that 1 PDF but
> it didnt work either. 

You can of course make all the pdf files separately and combine later
but that's harder as you need to use specific pdf-aware libraries to do
that, you can't just concatenate pdf files together: they have a rather
delicate internal structure. Also, if pages or other structures are
numbered, then simply joining the pdfs together isn't what you want to
do.

David





________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Received on Friday, 12 March 2004 09:59:27 UTC