FileDocCategorySizeDatePackage
SimpleXalan1.javaAPI DocExample1781Sun Sep 02 14:59:00 BST 2001chap5

SimpleXalan1

public class SimpleXalan1 extends Object
A simple demo of Xalan 1. This code was originally written using Xalan 1.2.2. It will not work with Xalan 2.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
Accept two command line arguments: the name of an XML file, and the name of an XSLT stylesheet. The result of the transformation is written to stdout.

        if (args.length != 2) {
            System.err.println("Usage:");
            System.err.println("  java " + SimpleXalan1.class.getName()
                    + " xmlFileName xsltFileName");
            System.exit(1);
        }

        /*
        NOTE: This code is commented out because it relies on an older
        version of Xalan.

        String xmlFileName = args[0];
        String xsltFileName = args[1];

        String xmlSystemId = new File(xmlFileName).toURL().toExternalForm();
        String xsltSystemId = new File(xsltFileName).toURL().toExternalForm();

        org.apache.xalan.xslt.XSLTProcessor processor =
                org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor();

        org.apache.xalan.xslt.XSLTInputSource xmlInputSource =
                new org.apache.xalan.xslt.XSLTInputSource(xmlSystemId);

        org.apache.xalan.xslt.XSLTInputSource xsltInputSource =
                new org.apache.xalan.xslt.XSLTInputSource(xsltSystemId);

        org.apache.xalan.xslt.XSLTResultTarget resultTree =
                new org.apache.xalan.xslt.XSLTResultTarget(System.out);

        processor.process(xmlInputSource, xsltInputSource, resultTree);
        */