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 April 12th, 2007, 01:55 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default xsl:result-document instruction

This might be a strange question.
If I have an XSLT with 2 xsl:result-document instructions, the first will output a XML file and second will output an HTML file. Is it possible to use the first outputed XML (using the document()) in the 2nd xsl:result-document instruction for the HTML?

Or is this not possible because XSLT builds the 2 xsl:result-document's before they are output?

(I am using saxon 8.8.)

Thanks,

 
Old April 12th, 2007, 04:26 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The spec says that it's not allowed to read and write from the same URI during a single transformation. This is basically because the order of execution is undefined, so you don't know whether your reading before writing or after writing.

If you want to, you can cheat: you can use different URIs that refer to the same resource, for example file:///c:/doc.xml and file:///C:/DOC.XML.

But why would you want to? Just write the document to a variable before doing the xsl:result-document, and then you can read it from the variable.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 12th, 2007, 05:00 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi Michael,

I will try both ways.

Thanks

 
Old April 12th, 2007, 06:01 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Nice work-around. Both work perfect :)

Thanks again.








Similar Threads
Thread Thread Starter Forum Replies Last Post
grouping and result-document help mrame XSLT 2 October 21st, 2008 11:01 PM
xsl:exclude-result-prefixes #all and #default maxtoroq BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 4 July 28th, 2008 12:10 PM
SAXON - result-document bonekrusher XSLT 3 May 7th, 2007 08:27 AM
xsl template, next result or next 10 results ge_or_gi XSLT 8 April 2nd, 2007 07:01 AM
Create processing instruction in XSL hbcontract XML 6 May 7th, 2004 12:14 PM





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