jd.xslt - Quickstart

  1. In order to use jd.xslt you need a Java Virtual Machine, version 1.1 or higher.

  2. Download and install the jd.xslt distribution and any additional third party libraries.
    Be sure to include all downloaded libraries into the classpath or pass them directly to the java interpreter via the -classpath option.

  3. Go to the installation directory and run a demo transformation by typing:

    java jd.xml.xslt.Stylesheet demo.xml demo.xsl

    The transformation is performed by calling the class jd.xml.xslt.Stylesheet passing an input xml document and a xsl document which defines the transformation rules. The transformed document is directly written to the console.

  4. To redirect the output to a file, use the -out option

    java jd.xml.xslt.Stylesheet -out demo.out demo.xml demo.xsl

    and the output is written to the file demo.out.

  5. To set the value of a top-level parameter use the -param option. The first argument after -param is the parameter name, the second a context free XPath expression representing the value:

    java jd.xml.xslt.Stylesheet -param filename 'demo' demo.xml demo.xsl

  6. If the xml document contains one or more <?xml-stylesheet?> instructions (like demo.xml does) the xsl-file argument can be skipped:

    java jd.xml.xslt.Stylesheet demo.xml

  7. Per default the SAX parser Crimson or Xerces from the Apache project is used to parse the XML documents. If you want to use another parser, specify it's classname via the -parser-option:

    java jd.xml.xslt.Stylesheet -parserxml myxml.MySaxParser demo.xml

  8. For a complete list of all command-line options call jd.xml.xslt.Stylesheet with no arguments. A detailed description of the options can be found here.

  9. For further info about how to use jd.xslt take a look at the Programming Guide.


main page