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 January 15th, 2007, 06:35 PM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generating a new file for-each element

Hi all,

I have one xml file with many SVG elements. For each SVG element I
need to generate a new *.svg file. Do I control this in the code for the transformer or in the xsl-template? Where can I find information about this?

XML file:
<root>
 <svg>
  <desc></desc>
  <g></g>
 </svg>
 <svg>
  <desc></desc>
  <g></g>
 </svg>
</root>

Thanks in advance...

Regards,
Jack

 
Old January 15th, 2007, 07:03 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 you can generate multiple output documents using the xsl:result-document instruction.

Some XSLT 1.0 processors have vendor extensions which do the same thing.

If you haven't got access to this capability (i.e. you're using a standard XSLT 1.0 processor) then you need to call the transformer once per output file from your application layer, passing a parameter to say which output file you want to generate.

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
Getting value of an element in an XML file semilemon C# 2005 5 April 13th, 2007 07:54 AM
dynamically generating Excel file sunitapandey Struts 3 November 23rd, 2006 03:53 AM
file form element nerssi Javascript 3 January 18th, 2005 06:14 AM
generating a fixed length export file cooky4 VB Databases Basics 3 October 27th, 2003 03:42 PM





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