"xalan" Command in fop-0.20.5-bin.zip

Q

What Is the "xalan" command in fop-0.20.5-bin.zip? Can I use it to transform XML file using XSLT templates?

✍: FYIcenter.com

A

"xalan" command is the command line tool that allows you to run FOP 0.20.5 as a standalone application to transform any XML file with a given XSLT template. It reads an XML file and an XSLT file. The output is what ever the XSLT file wants to generate.

"xalan" command is actually system command script. The Windows version, \local\fop-0.20.5\xalan.bat, is provided below:

@ECHO OFF

set LIBDIR=lib
set LOCALCLASSPATH=build/fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar
java -cp %LOCALCLASSPATH% org.apache.xalan.xslt.Process %1 %2 %3 %4 %5 %6 %7 %8

"xalan" command requires that the environment variable JAVA_HOME be set to a path pointing to the appropriate Java installation on your system. See the session below on how to use the "xalan" command:

\fyicenter>cd \local\fop-0.20.5

\local\fop-0.20.5>echo %java_home%
   \Program Files\Java\jdk1.8.0_45\

\local\fop-0.20.5>xalan

Xalan-J command line Process class options:

                        -Common Options-

[-XSLTC (use XSLTC for transformation)]
[-IN inputXMLURL]
[-XSL XSLTransformationURL]
[-OUT outputFileName]
[-V (Version info)]
[-EDUMP {optional filename} (Do stackdump on error.)]
[-XML (Use XML formatter and add XML header.)]
[-TEXT (Use simple Text formatter.)]
[-HTML (Use HTML formatter.)]
[-PARAM name expression (Set a stylesheet parameter)]
[-MEDIA mediaType (use media attribute to find stylesheet associated 
   with a document.)]");
[-FLAVOR flavorName (Explicitly use s2s=SAX or d2d=DOM to do transform.)]");  
   // Added by sboag/scurcuru; experimental
[-DIAG (Print overall milliseconds transform took.)]");
[-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]
[-ENTITYRESOLVER full class name (EntityResolver to be used to resolve 
   entities)]
[-CONTENTHANDLER full class name (ContentHandler to be used to serialize 
   output)]

                        -Options for Xalan-

[-QC (Quiet Pattern Conflicts Warnings)]
[-TT (Trace the templates as they are being called.)]
[-TG (Trace each generation event.)]
[-TS (Trace each selection event.)]
[-TTC (Trace the template children as they are being processed.)]
[-TCLASS (TraceListener class for trace extensions.)]
[-L use line numbers for source document]
[-INCREMENTAL (request incremental DTM construction by setting
   http://xml.apache.org/xalan/features/incremental true.)]");
[-NOOPTIMIMIZE (request no stylesheet optimization proccessing by setting
   http://xml.apache.org/xalan/features/optimize false.)]");
[-RL recursionlimit (assert numeric limit on stylesheet recursion depth.)]");

                        -Options for XSLTC-

[-XO [transletName] (assign the name to the generated translet)]
[-XD destinationDirectory (specify a destination directory for translet)]
[-XJ jarfile (packages translet classes into a jar file of name <jarfile>)]
[-XP package (specifies a package name prefix for all generated translet 
   classes)]
[-XN (enables template inlining)]
[-XX (turns on additional debugging message output)]
[-XT (use translet to transform if possible)]

 

FAQ for FOP (Formatting Object Processor)

"fop" Command in fop-0.20.5-bin.zip

Download and Installing of FOP Older Versions

⇑⇑ FAQ for FOP (Formatting Object Processor)

2016-02-10, 2191👍, 0💬