XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Mike SappSubject: 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?

Best and thank you for your help in advance!

Mike

Postnext
(Deleted User) 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...

Alberto

Postnext
Mike SappSubject: 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?

Posttop
(Deleted User) Subject: input & outputdir question
Author: (Deleted User)
Date: 18 Jun 2007 08:04 AM
Hi Mike,
you can get the file name of a source document by using fn:base-uri(/); then, use fn:tokenize to split into filename and directories.

Hope this helps,
Alberto

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.