Using Xalan Java for processing XML with XSLT
Xalan Java is an XSLT processor. With this processor you can transform the XML document in to other formats as required by your application. You can use this processor from within your program or in command line. It can also be integrated in other programs. It implements XSLT version 1.0, XPath version 1.0, and JAXP 1.3.
To work with the Xalan Java XSLT processor you have to download it and set the classpath to the jar files xalan.jar, xml-apis.jar, serializer.jar, and xercesImpl.jar.
use the processor you have to call the Process class in the command
line while calling java. A typical command line command would be something
like, java org.apache.xalan.xslt.Process -IN ur_xml_file.xml -XSL ur_xsl_file.xsl
In the command line you can find the flags -IN is used to specify the XML file that you want to transform and the -XSL is used to specify the XSL file that is used for the transformation.
Suppose you want only the text values of the elements to be included in the output you can use the flag -TEXT. To write HTML, you can use the flag -HTML. Check the documentation for the other flags that might be applicable to your application.
Copyright - © 2004 - 2018 - All Rights Reserved.