p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > XML > XSLT
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 3rd, 2006, 12:49 PM
Registered User
 
Join Date: Oct 2006
Location: Bangalore, Karnataka, India.
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 3rd, 2006, 01:04 PM
joefawcett's Avatar
Wrox Author
Points: 8,994, Level: 40
Points: 8,994, Level: 40 Points: 8,994, Level: 40 Points: 8,994, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 3rd, 2006, 01:14 PM
Registered User
 
Join Date: Oct 2006
Location: Bangalore, Karnataka, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old November 3rd, 2006, 01:23 PM
mhkay's Avatar
Wrox Author
Points: 12,735, Level: 48
Points: 12,735, Level: 48 Points: 12,735, Level: 48 Points: 12,735, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old November 3rd, 2006, 01:49 PM
joefawcett's Avatar
Wrox Author
Points: 8,994, Level: 40
Points: 8,994, Level: 40 Points: 8,994, Level: 40 Points: 8,994, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old November 3rd, 2006, 03:13 PM
Registered User
 
Join Date: Oct 2006
Location: Bangalore, Karnataka, India.
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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old November 3rd, 2006, 03:53 PM
mhkay's Avatar
Wrox Author
Points: 12,735, Level: 48
Points: 12,735, Level: 48 Points: 12,735, Level: 48 Points: 12,735, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old November 3rd, 2006, 04:10 PM
Registered User
 
Join Date: Oct 2006
Location: Bangalore, Karnataka, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How to invoke the processor?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML/XSLT Transform Error in ASP kwilliams Classic ASP XML 2 October 9th, 2007 03:26 AM
How do I transform XSLT without the <?xml?> tag? nadavvin XSLT 4 June 10th, 2007 10: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 09:18 PM
Transform .xsd files to a .xml file lxu XSLT 0 July 19th, 2004 10:23 PM



All times are GMT -4. The time now is 03:51 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc