Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2007, 05:46 PM
Registered User
 
Join Date: Oct 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default outputting to multiple documents?

i am not sure if this should be in an XSLT forum or an XSLT-FO.

I have an xml document that would look something like this
<invoice>
            <doc>
                        <number>100001</number>
                        <details> blah blah blah </details>
            </doc>
<doc>
                        <number>100002</number>
                        <details> blah blah blah </details>
            </doc>
<doc>
                        <number>100003</number>
                        <details> blah blah blah </details>
            </doc>
</invoice>

I want to export each document to a separate pdf, eg 100001.pdf, 100002.pdf , 100003.pdf. Is this possible if so how?

if someone could point me in the right direction i would be grateful.


 
Old November 7th, 2007, 06:42 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT 2.0 allows multiple output files using the <xsl:result-document> instruction.

Some XSLT 1.0 processors have similar facilities as a vendor extension. Failing that, you can sometimes do-it-yourself using calls to Javascript or whatever.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 7th, 2007, 07:26 PM
Registered User
 
Join Date: Oct 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mhkay
XSLT 2.0 allows multiple output files using the <xsl:result-document> instruction.
is there anywhere online that details this? this sounds ideal.




 
Old November 7th, 2007, 07:52 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default


http://www.w3.org/TR/xslt20/#creating-result-trees

Clearly, if you're planning to put each of the XSLT result documents through an FO processor to create PDF, then you're going to have to organize the workflow in some way. If you're using Saxon then you could write an OutputURIResolver that intercepts each result tree as it is written and passes it to an XSL-FO processor.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Not outputting a specific node zach_1988 XSLT 3 December 2nd, 2008 10:49 AM
multiple input documents pcase XSLT 2 January 8th, 2008 07:51 PM
Outputting Conditional Comments ole_v2 XSLT 2 November 13th, 2006 03:39 PM
Outputting Array manih C++ Programming 2 June 14th, 2006 08:24 PM
Referencing multiple XML documents... qornboy XML 3 October 9th, 2003 09:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.