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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext 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

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
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.