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 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
M KlineSubject: can user run .xsl on a Citrix station?
Author: M Kline
Date: 21 May 2007 10:36 AM
Hello,
I have a .xsl file which converts an XML to a .txt document. I convert this weekly for a user in my Accounting Department and email them the results. I have created a java script via StylusStudio that I run on my laptop to convert the XML. I'd rather they do this themselves but the users here all run on Citrix, so I'm wondering is there a way they could run this on their own Citrix session?

Besides the XML input file, what else would they need in order to run the following, and would they run this from a folder or would there be a specific command?


package Stryker820Conversion;

import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import net.sf.saxon.FeatureKeys;
import net.sf.saxon.om.Validation;

/** Run an XSLT
* This class requires the following items in the classpath.
* C:/Documents and Settings/mkline/My Documents/StylusStudio Projects/Stryker820/Stryker820Conversion
* C:/Program Files/Stylus Studio 2007 XML Enterprise Suite Release 2/bin/saxon8sa.jar
*/

public class Stryker820Conversion {

public static void main(String[] args) throws Exception {

String inputUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/export-820.xml";
String outputUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/820_Output_Styker820.txt";
String xsltUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/820_111006FINAL.xsl";

TransformerFactory tFactory = new com.saxonica.SchemaAwareTransformerFactory();
tFactory.setAttribute(FeatureKeys.RECOGNIZE_URI_QUERY_PARAMETERS, Boolean.TRUE);
tFactory.setAttribute(FeatureKeys.STRIP_WHITESPACE, "ignorable");
tFactory.setAttribute(FeatureKeys.VERSION_WARNING, Boolean.FALSE);
tFactory.setAttribute(FeatureKeys.SCHEMA_VALIDATION, new Integer(Validation.LAX));
tFactory.setAttribute(FeatureKeys.VALIDATION_WARNINGS, Boolean.TRUE);

Transformer transformer = tFactory.newTransformer(new StreamSource(xsltUrl));


System.out.println();
System.out.println("XSLT starting.");
transformer.transform(new StreamSource(inputUrl),
new StreamResult(outputUrl));
System.out.println("XSLT finished.");

}
}



I will try to upload the files.

Thanks much


Document820_111006FINAL.xsl


Unknown_20_111006FINAL.class

Postnext
(Deleted User) Subject: can user run .xsl on a Citrix station?
Author: (Deleted User)
Date: 21 May 2007 02:25 PM
Hi,
the Java code is using the schema-aware version of Saxon, so you can run it outside of Stylus Studio only if you buy a stand-alone license from Saxonica; if you used the basic version of Saxon you could just run it from the command line, and I guess it would run fine under Citrix.

Hope this helps,
Alberto

Postnext
M KlineSubject: can user run .xsl on a Citrix station?
Author: M Kline
Date: 25 May 2007 12:28 PM
Here's what the code looks like now.

I know nothing about running Java from a command line, so how would they run this? Would it be from a dos prompt and if so, what would the command look like? What would need to reside on their machine in order to do this?

Thanks




package Stryker820Conversion;

import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import net.sf.saxon.FeatureKeys;

/** Run an XSLT
* This class requires the following items in the classpath.
* C:/Documents and Settings/mkline/My Documents/StylusStudio Projects/Stryker820/Stryker820Conversion
* C:/Program Files/Stylus Studio 2007 XML Enterprise Suite Release 2/bin/saxon8sa.jar
*/

public class Stryker820Conversion {

public static void main(String[] args) throws Exception {

String inputUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/export-820.xml";
String outputUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/820_Output_Styker820.txt";
String xsltUrl = "file:///c:/Documents%20and%20Settings/mkline/My%20Documents/StylusStudio%20Projects/Stryker820/820_111006FINAL.xsl";

TransformerFactory tFactory = new net.sf.saxon.TransformerFactoryImpl();
tFactory.setAttribute(FeatureKeys.RECOGNIZE_URI_QUERY_PARAMETERS, Boolean.TRUE);
tFactory.setAttribute(FeatureKeys.STRIP_WHITESPACE, "ignorable");
tFactory.setAttribute(FeatureKeys.VERSION_WARNING, Boolean.FALSE);

Transformer transformer = tFactory.newTransformer(new StreamSource(xsltUrl));


System.out.println();
System.out.println("XSLT starting.");
transformer.transform(new StreamSource(inputUrl),
new StreamResult(outputUrl));
System.out.println("XSLT finished.");

}
}

Posttop
Ivan PedruzziSubject: can user run .xsl on a Citrix station?
Author: Ivan Pedruzzi
Date: 25 May 2007 07:05 PM


The question is more on generic Java programming then specific to Stylus Studio.


Given the example and assuming that the Java class is compiled and compressed in a jar file called Stryker820Conversion.jar you can invoke it with

java -classpath Stryker820Conversion.jar;saxon.jar Stryker820Conversion.Stryker820Conversion

 
Topic Page 1 2 3 4 5 6 7 8 9 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.