XSLT workflow with variable number of source files

Posted by chiborg on Stack Overflow See other posts from Stack Overflow or by chiborg
Published on 2010-06-01T16:04:23Z Indexed on 2010/06/01 16:53 UTC
Read the original article Hit count: 314

Filed under:
|
|
|

I have a bunch of XML files with a fixed, country-based naming schema: report_en.xml, report_de.xml, report_fr.xml, etc. Now I want to write an XSLT style sheet that reads each of these files via the document() XPath function, extracts some values and generates one XML files with a summary. My question is: How can I iterate over the source files without knowing the exact names of the files I will process?

At the moment I'm planning to generate an auxiliary XML file that holds all the file names and use the auxiliary XML file in my stylesheet to iterate. The the file list will be generated with a small PHP or bash script. Are there better alternatives?

I am aware of XProc, but investing much time into it is not an option for me at the moment. Maybe someone can post an XProc solution. Preferably the solution includes workflow steps where the reports are downloaded as HTML and tidied up :)

I will be using Saxon as my XSLT processor, so if there are Saxon-specific extensions I can use, these would also be OK.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about Workflow