[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Single output from many inputs

Subject: Re: Single output from many inputs
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Nov 2007 07:26:29 -0500
Re:  Single output from many inputs
At 2007-11-13 11:58 +0000, David Sinclair wrote:
I have an ant build file and one of the tasks we need to do is to collect all the elements that have a certain attribute across many files in our code base into one xml file.

Does anyone here know of a way to use XSLT to do this? I had thought to use the xslt ant task to run on all files with a certain extension and collect all the values but I cant find a way to collect the results of each transform into the same file.

       <xslt basedir="${sourcedir}" destdir="${targetdir}"
           style="extract-shared-instances.xsl" includes="**/*.xhtml"
           extension=".xhtml" force="true"/>

Thanks in advance for any assistance you can give me,

You will have to use a single XSLT script that obtains the information from all of the files.


Using XSLT 2.0 will serve you better than the XSLT 1.0 that is in Ant, and Saxon is an example of a Java-based processor that can be invoked from Ant. The collection() function will open all of the files for you.

If you need to stick with XSLT 1.0 there is more effort involved in order to create your list of files in an XML file and then use that XML file as input to the transformation so that you have the filenames to open. The document() function is used to open the other files based on the file names being in the input XML.

I hope this helps.

. . . . . . . . . . . Ken

--
Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.