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 March 22nd, 2010, 02:20 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple inputs: process all files in directory

I would like to capture a sequence of elements that belong to multiple input XML files that are contained in the same directory as the XSLT document:

<xsl:variable name="allfiles" select="*.xml/descendant::testdata"/>

I am using Saxon and XSLT 2.0.

I found some documentation that suggested I could use something like this:

<xsl:for-each select="file:///path/to/directory">
<!-- process the documents -->
</xsl:for-each>

but that was not working for me. Any suggestions?
 
Old March 22nd, 2010, 02:30 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You need to use the document() or collection() functions.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old March 22nd, 2010, 02:41 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Sam, it was an error on my part. I am using

collection('file:///Users/path/to/files?select=*.xml')/descendant::testdata

and it works perfectly.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Inputs: collections stolte XSLT 4 March 9th, 2010 09:09 AM
process all xml files in folder lsantos2000 XSLT 4 November 8th, 2007 01:41 PM
Directory not being released by process cptclyde Oracle 0 March 22nd, 2007 10:38 AM
1 form for multiple inputs Vince_421 Access VBA 2 February 6th, 2007 04:06 AM
Multiple inputs on same page kev_79 Access 3 July 8th, 2003 11:16 PM





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