Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 22nd, 2010, 02:20 PM
Authorized User
 
Join Date: May 2007
Location: , , .
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?
Reply With Quote
  #2 (permalink)  
Old March 22nd, 2010, 02:30 PM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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?
Reply With Quote
  #3 (permalink)  
Old March 22nd, 2010, 02:41 PM
Authorized User
 
Join Date: May 2007
Location: , , .
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.
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.