XMLMill - convert xml to pdf with java. Generate PDF from xml/xsl.

XMLMill User Guide

Version: 3.00 Date: January 2nd, 2008
This tutorial is opened in a separate window in order to maximize the legibility of this tutorial.
To return to XMLMill, close this browser window

This page as PDFPrinter friendly pageThis guide (!) as PDF

XMLMill and JS2E

In the following section an overview is given of how to use XMLMill in different environments. As XMLMill is JAXP compliant you should be able to use XMLMill in any environment that supports JAXP.

XMLMill / JS2E 1.3

As the JDK 1.3 version does not include any xml parser nor xsl transformer libraries nor a logging mechanism, you need to add external libraries to the classpath, for example:

[001] 
[002] set JAVA_HOME= "C:\Program Files\JavaSoft\sdk131_07\bin"
[003] set XML_HOME=c:\xmlmill3.00
[004] 
[005] set CLASSPATH=%XML_HOME%\lib\xercesimpl.jar
[006] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\xalan.jar
[007] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\jaxp-api.jar
[008] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\sax.jar   
[009] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\dom.jar   
[010] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\xmlmill.jar
[011] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\commons-logging-1.1.jar 
[012] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\log4j.jar   
[013] 
[014] %JAVA_HOME%\java com.xmlmill.applet.Main                  
[015]             

  • In case you use the default com.xmlmill.log.FileLogger class there is no need to add the log4j library.
  • See the etc/batch.cmd or etc/gui.cmd command file for an example

XMLMill / JS2E 1.4

As the JDK 1.4 version does include an xml parser and xsl-transformer and logging mechanism (java.util.logging. package), there is no need to add external libraries to the classpath, for example:

[001] 
[002] set JAVA_HOME= C:\j2sdk1.4.2_04\bin
[003] set XML_HOME=c:\xmlmill3.00
[004] 
[005] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\xmlmill.jar
[006] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib\commons-logging-1.1.jar   
[007] 
[008] %JAVA_HOME%\java com.xmlmill.applet.Main                  
[009]             

  • See the etc/batch.cmd or etc/gui.cmd command file for an example

XMLMill / JS2E 1.5

As the JDK 1.5 version does include an xml parser and xsl-transformer, there is no need to add external libraries to the classpath, for example:

[001] 
[002] set JAVA_HOME= "C:\Program Files\Java\jdk1.5.0_01\bin"
[003] 
[004] set XML_HOME=c:\xmlmill3.00
[005] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-jdk5.0\xmlmill.jar
[006] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-jdk5.0\commons-logging-1.1.jar   
      
[008]  
[009] 
[010] %JAVA_HOME%\java com.xmlmill.applet.Main                  
[011]             

  • See the etc/batch.cmd or etc/gui.cmd command file for an example

XMLMill / Saxon 8.0 / JS2E 1.4

Saxon ( http://www.saxonica.com/) is an XSLT transformer which can be used as an alternative of Xalan. To use Saxon, you need to add the dom.jar and jaxp-api.jar libraries of the JAXP 1.3 implementation (http://java.sun.com/xml/jaxp/) to the classpath in order to be able to do validation. Adding a xml-parser is not necessary as the default (Xerces) parser included in the SDK1.4 will be used:

[001] 
[002] set JAVA_HOME= C:\j2sdk1.4.2_04\jre\bin
[003] 
[004] set XML_HOME=c:\xmlmill3.00
[005] set CLASSPATH=%XML_HOME%\lib-saxon8.2b-jdk1.4\saxon8.2a.jar
[006] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\dom.jar
[007] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\jaxp-api.jar
[008] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\xmlmill.jar
[009] set 
      CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\commons-logging-1.1.j
      ar
[012] 
[013]  %JAVA_HOME%\java -Djaxp.debug=true 
       -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=net.s
       f.saxon.TransformerFactoryImpl  
       -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImp
       l  com.xmlmill.applet.Main
[018]             

  • Do not forget to add the -D property indicating that the Saxon XSL transformer and Validator should be used instead of the transformer (Xalan) defined in the JS2E 1.4 version.
  • See the etc/batch.cmd or etc/gui.cmd command file for an example.
  • If you add the -Djaxp.debug=true option more information will be printed regarding the selection of the implementation classes (the information will be printed directly on the console).

XMLMill / Saxon 8.0 / JS2E 1.5

Saxon ( http://www.saxonica.com/) is an XSLT transformer which can be used as an alternative of Xalan. To use Saxon with JS2E 1.5, the saxon.jar should be added to the classpath, for example:

[001] 
[002] set JAVA_HOME= C:\j2sdk1.4.2_04\jre\bin
[003] 
[004] set XML_HOME=c:\xmlmill3.00
[005] set CLASSPATH=%XML_HOME%\lib-saxon8.2b-jdk1.4\saxon8.2a.jar
[006] set CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\xmlmill.jar
[007] set 
      CLASSPATH=%CLASSPATH%;%XML_HOME%\lib-saxon8.2b-jdk1.4\commons-logging-1.1.j
      ar
[010] 
[011]  %JAVA_HOME%\java -Djaxp.debug=true 
       -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=net.s
       f.saxon.TransformerFactoryImpl  
       -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImp
       l  com.xmlmill.applet.Main
[016]             

  • Do not forget to add the -D property indicating that the Saxon XSL transformer and Validator should be used instead of the transformer (Xalan) defined in the JS2E 1.5 version.
  • See the etc/batch.cmd or etc/gui.cmd command file for an example
Copyright © 2001 - 2012. All rights reserved. XMLMill and XMLMill logo are trademarks of Pecunia Data Systems, bvba.
Powered by Apache CocoonPowered by XMLMill