FileDocCategorySizeDatePackage
XSLTransform.javaAPI DocExample896Sun Mar 14 10:01:20 GMT 2004None

XSLTransform

public class XSLTransform extends Object
Demonstrate transforming a file using XSLT, with Apache Xalan API. See also: JAXPTransform.

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


		try {
			// Require three input args
			if (args.length != 3) {
				System.out.println("Usage: java XSLTransform <input XML file> <input XSL file> <output file>");
				System.exit(1);
			}

			XSLTProcessor myProcessor = XSLTProcessorFactory.getProcessor();

			myProcessor.process(new XSLTInputSource(args[0]),
					new XSLTInputSource(args[1]),
					new XSLTResultTarget(args[2]));
		}
		catch (org.xml.sax.SAXException exc) {
			System.err.println("Found invalid XML during processing:");
			exc.printStackTrace();
		}