FileDocCategorySizeDatePackage
XSLTransform.javaAPI DocExample1621Sat Jan 24 10:44:40 GMT 2004je3.xml

XSLTransform

public class XSLTransform extends Object
Transforms an input document to an output document using an XSLT stylesheet. Usage: java XSLTransform input stylesheet output

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

	// Set up streams for input, stylesheet, and output.
	// These do not have to come from or go to files.  We can also use the
	// javax.xml.transform.{dom,sax} packages use DOM trees and streams of
	// SAX events as sources and sinks for documents and stylesheets.
	StreamSource input = new StreamSource(new File(args[0]));
	StreamSource stylesheet = new StreamSource(new File(args[1]));
	StreamResult output = new StreamResult(new File(args[2]));
	
	// Get a factory object, create a Transformer from it, and 
	// transform the input document to the output document.
	TransformerFactory factory = TransformerFactory.newInstance();
	Transformer transformer = factory.newTransformer(stylesheet);
	transformer.transform(input, output);