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 3rd, 2006, 12:49 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can 1 xslt transform an xml doc into 2 text files

I would like to know if it is possible to transform an xml document into 2 text file using only one xslt.
 
Old November 3rd, 2006, 01:04 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In XSLT 2.0 you can have as many output documents as you like. In version 1.0 you'll need to use scripting or an extension. What processor are you using?

--

Joe (Microsoft MVP - XML)
 
Old November 3rd, 2006, 01:14 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using MSXML v3.0 and the xslt ver 1.0

 
Old November 3rd, 2006, 01:23 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In XSLT 2.0 there is an instruction xsl:result-document that allows you to produce multiple output files. Some XSLT 1.0 processors have similar capabilities as vendor extensions. If yours doesn't, you can always invoke the processor twice, with different parameters, once to produce each output file.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 3rd, 2006, 01:49 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Then do as Michael suggests, with two transforms, or look at the msxsl:script element in the SDK combined with the FileSystemObject: http://msdn.microsoft.com/library/de...asp?frame=true
I have seen some examples on Google of this so try searching for some of those terms.

--

Joe (Microsoft MVP - XML)
 
Old November 3rd, 2006, 03:13 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Mr Michael Kay,

"you can always invoke the processor twice, with different parameters, once to produce each output file."

can u give few lines of code on the above or refer me on the material for it.

thanks
Raju



 
Old November 3rd, 2006, 03:53 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Which part don't you understand?

- How to invoke the processor?

- How to supply parameters?

- How to produce an output file?

They're all pretty basic, they're all well covered in documentation, and they all depend on which XSLT processor you are using.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 3rd, 2006, 04:10 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How to invoke the processor?






Similar Threads
Thread Thread Starter Forum Replies Last Post
XML/XSLT Transform Error in ASP kwilliams Classic ASP XML 2 October 9th, 2007 02:26 AM
How do I transform XSLT without the <?xml?> tag? nadavvin XSLT 4 June 10th, 2007 09:25 AM
Transform XML with XSLT in JavaScript Mozilla Spankmaster79 Javascript 3 January 18th, 2006 07:31 AM
XSLT read through XML to transform another XML dendenx2 XSLT 8 July 7th, 2005 08:18 PM
Transform .xsd files to a .xml file lxu XSLT 0 July 19th, 2004 09:23 PM





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