XSLT Process in fop-2.0-bin.zip

Q

How to run the XSLT process in fop-2.0-bin.zip transform XML files using XSLT templates?

✍: FYIcenter.com

A

fop-2.0-bin.zip comes with the xalan-2.7.0.jar, which can be used to perform an XSLT process to transform an XML file using XSLT template. The XSLT process reads an XML file and an XSLT file. The output is what ever the XSLT file wants to generate.

See the session below on how to run run the XSLT process:

\fyicenter>cd \local\fop-2.0

\local\fop-2.0>java
java version "1.7.0_45"

\local\fop-2.0>java -cp .\lib\xalan-2.7.0.jar 
   org.apache.xalan.xslt.Process
Xalan-J command line Process class options:

                     -Common Options-

[-XSLTC (use XSLTC for transformation)]
[-IN inputXMLURL]
[-XSL XSLTransformationURL]
[-OUT outputFileName]
[-E (Do not expand entity refs)]
[-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.)]
[-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)]
[-SECURE (set the secure processing feature to true.)]

                     -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 processing 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)]

Back to FAQ on FOP (Formatting Objects Processor).

2016-07-05, 865👍, 0💬