Subject: [xsl] SAX for XSL Transformation From: "santhosh nair" <santhosh_as@xxxxxxxxxxx> Date: Thu, 17 Feb 2005 10:29:26 -0800 |
Package com.ual.amis.frmfim; import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*;
public Transform() { }
public static void main(String[] args) { // If not enough args, print usage. if (args.length < 3) { System.out.println( "Usage: XML-File Stylesheet Output-File"); System.exit(5); }
// Get command-line args. File xmlFile = new File(args[0]); File xslFile = new File(args[1]); File outFile = new File(args[2]);
// Create xsl source, input source, and result streams. StreamSource xslSource = new StreamSource(xslFile); StreamSource xmlSource = new StreamSource(xmlFile); StreamResult outResult = new StreamResult(outFile);
try { // Get transformer factory and transformer. TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(xslSource);
// Do transformation. transformer.transform(xmlSource, outResult); } catch(Exception ex) { System.out.println(ex); System.exit(16); } }
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] breaking xsl loop or temp, Prasad Akella | Thread | RE: [xsl] SAX for XSL Transformatio, Michael Kay |
Re: [xsl] Adding element to xml sni, Nishi Bhonsle | Date | Re: [xsl] Javascript variable to XS, Camaleón |
Month |