There are
many approaches to process the XML document using Java and XSL. One
of the ways is to use the Xalan Java XSLT processor. To use this XSLT
processor you have to download it and set the classpath to some of the
jar files.
_______________________________________________
The
jar files that are to be included in the classpath are xalan.jar, xml-apis.jar,
serializer.jar, and xercesImpl.jar. You can also work with the Xalan
Java XSLT processor from the command line by calling java and the Process
class.
A typical
command line command would be,
java org.apache.xalan.xslt.Process -IN ur_xml_file.xml -XSL ur_xsl_file.xsl
-OUT ur_output.out
There are
many command line flags that can be used to give an appropriate output.
For example if you want the output to include only the text values of
the elements instead of the element names, you could use the -TEXT option.
To output
the HTML you can use the -HTML option. In the example given above you
can find the flags -IN and -XSL are used to input the XML file you want
to transform and the XSL file that is used for the transformation.