Subject:input & outputdir question Author:Mike Sapp Date:15 Jun 2007 09:55 AM
Hello all at Stylus,
Im doing a batch transformation and would like to ouput the renamed files to the input files directory. My xsl looks like this:
<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="outputdir" select="'file:///c:/temp'"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:result-document href="{$outputdir}/{feed/release/label/name}.xml" method="xml">
<document>
I would like to have the ouputdir to be the same as all of the input files which i am batch transforming... It is a simple input folder structure with one parent directory with over 1500 direct sub directories so a simple file:///c:/temp wont work... Any tips?
Subject:input & outputdir question Author:(Deleted User) Date:15 Jun 2007 11:51 AM
Hi Mike,
it's not clear which directory (the input or the output one) has the sub-directories; however, if you want to generate one file per label, you must use a for-each, otherwise you are just generating a single output file...
Subject:input & outputdir question Author:Mike Sapp Date:16 Jun 2007 02:01 AM Originally Posted: 16 Jun 2007 01:00 AM
Hello Alberto,
The input would be from a master directory(Release) and all sub directory folders. Ie: ://Release/01, ://Release/02, ://Release/03
I would like the output file to be saved in the same sub-folder as the input file was located... How would i do that if the output specified is file:///c:/temp currently-. Is it possible?
Another option that could work for us is to use the current file name with the addition of the various href parameters we have specified...
<xsl:result-document href="{$outputdir}/{feed/release/label/name}_{CURRENT FILE NAME HERE}.xml" method="xml"> but am not sure how to insert the current file name... What would i use to have the current filename included in the href output dir?