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

Re: Creating csv from multiple input files

Subject: Re: Creating csv from multiple input files
From: "Georg Hohmann" <georg.hohmann@xxxxxxxxx>
Date: Tue, 6 May 2008 16:31:50 +0200
Re:  Creating csv from multiple input files
>  So you could use
>   <xsl:apply-templates
> select="collection('file:///C:/dir/subdir?select=*.xml')/*/*"/>
>  to process all child elements of all root elements of those .xml files in
> the directory C:\dir\subdir.

Thanks for the answer.
Following your advice i modified my stylesheet like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output name="csv" method="text" encoding="UTF-8"/>
  <xsl:template match="/">
     <xsl:result-document format="csv" href="result.csv">
        <xsl:apply-templates
select="collection('data/input?select=*.xml')/*/*"/>
        <xsl:text>&#x0d;&#x0a;</xsl:text>
     </xsl:result-document>
  </xsl:template>
...

"data/input" is the path relative to my xslt where the input files
resist. Now i wonder how i should run saxon9 from the command line.
Saxon9 needs an input file, but now the input files are all defined
inside the stylesheet. I was thinking of something like this:

java -jar saxon9.jar xml2csv.xslt

But this does not work due to the lack of an input file.
Could you please help a bit further?

Georg.

P.S.: Meanwhile i will generate a simple shell script like Wendell suggested.
That is the most obviously approach that i didn't thought of.
Sometimes too much xslt makes me blind :-)

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.