|
next
|
Subject: 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 820_111006FINAL.xsl
_20_111006FINAL.class
|
|
|