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)
-> + Stylus 2010 and Win 7 problem ... (6)
-> + Cannot set XSLT source files w... (3)
-> - Simple TXT to HTML Convertor! ... (1)
-> - Invoking XSLT and FOP Processe... (2)
-> ->Invoking XSLT and FOP Pro...
-> - Add Node and Pattern for Mutlp... (1)
-> - How to get xsl:message output ... (1)
-> + WSDL for Cvent Web Service (5)
-> - newbie question: IS there a "f... (1)
-> + Windows 7 64-bit Java. Stylus ... (3)
-> + Stylus Studio Enterprise crash... (2)
-> - XML to Access or SQL? Newbie N... (1)
-> - xml to flat file mapping using... (1)
-> + Missing Document Wizards (2)
-> - XSLT mapping and (1)
-> + Citrix Softgrid package proble... (2)
-> - xsl:import dropping the attrib... (1)
-> + XSLT mapping between schemas (5)
-> + Modifying/Creating existing CA... (9)
-> - Creating XML Sample Stream fro... (1)
-> - Integer to hex (1)
-- Previous [601-620] [621-640] [641-660] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Bob NugentSubject: Invoking XSLT and FOP Processes Other Than Thru Scenarios?
Author: Bob Nugent
Date: 03 Mar 2010 06:00 PM
Originally Posted: 03 Mar 2010 05:59 PM
Hi,

I am new to Stylus Studio and have two basic questions about using scenarios to invoke XSLT and FOP. I'm getting used to the "scenario" concept in XSLT editing environment and it's great when one is developing stylesheets - however:

1. There are times when I just need to apply an existing XSLT stylesheet to varying source XML files/ streams as part of testing upstream XML generation processes -

Within SSES 2010 is there a way to apply an existing XSLT stylesheet to varying XML source files other than via "scenarios" applied in XSLT editing environment? It seems that if I have an arbitry XML file I need to open the XSLT stylesheet itself (even though I don't need to change it), create a scenario for my source XML, and run the XSLT using that scenario?

2. In a similar vein: is there a way to invoke FOP from within SSES 2010 other than as a "post processing" step to an XSLT transformation? It would be nice to be able to invoke FOP directly against an FO file (independent of any preceding process which generated the FO). For example I may want to try certain FO syntax before bothering to write XSLT to generate that FO.

Thanks,
Bob

Posttop
Ivan PedruzziSubject: Invoking XSLT and FOP Processes Other Than Thru Scenarios?
Author: Ivan Pedruzzi
Date: 11 Mar 2010 11:55 AM
Hi Bob,

One elegant way for processing multiple documents is using XSLT and Saxon

The following transformation iterates through all XML files on c:\ and copy their content in a new file, named {file name}.out


<?xml version='1.0'?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/">

<xsl:template match="/">
<xsl:for-each select="collection('file:///c:/?select=*.xml')">
<xsl:variable name="tempDoc" select="saxon:discard-document(.)"/>
<xsl:result-document
indent="yes" method="xml"
href="{concat(document-uri($tempDoc), '.out')}">
<xsl:copy-of select="$tempDoc"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

   
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.