Changeset 904


Ignore:
Timestamp:
09/28/09 18:14:41 (3 years ago)
Author:
jharrop
Message:

Iff you are using Java 5, you need a stax implementation jar in order for Differencer to work.

Location:
trunk/docx4j
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/pom.xml

    r881 r904  
    77        <artifactId>docx4j</artifactId> 
    88        <name>docx4j</name> 
    9         <version>2.2.1</version> 
     9        <version>2.2.2</version> 
    1010        <description> 
    1111                docx4j is a library which helps you to work with the Office Open 
     
    106106        </repositories> 
    107107        <dependencies> 
     108         
     109                  <!--  Uncomment this if you are using Java 5.   
     110                                 
     111                                StAX reference implementation, 
     112                        required for MLInputFactory.newInstance() in Differencer 
     113                        iff you are using Java 1.5   
     114                        (not necessary for Java 6)  
     115                        --> 
     116                                <!--  
     117                        <dependency> 
     118                          <groupId>stax</groupId> 
     119                          <artifactId>stax</artifactId> 
     120                          <version>1.2.0</version>       
     121                                <exclusions> 
     122                                        <exclusion> 
     123                                        <groupId>stax</groupId> 
     124                                        <artifactId>stax-api</artifactId> 
     125                                        </exclusion> 
     126                                </exclusions> 
     127                        </dependency>  --> 
     128                        <!--  stax 1.2.0 grabs 1.0.1(!); jaxb would grab 1.0.2 (where from?) --> 
     129         
    108130                        <dependency> 
    109131                                <groupId>javax.xml.bind</groupId> 
     
    116138                                <artifactId>jaxb-impl</artifactId> 
    117139                                <version>2.1.3</version>  
     140                                 
    118141                        </dependency>  <!--  nothing newer in the repository! --> 
    119142         
  • trunk/docx4j/src/main/java/org/docx4j/diff/Differencer.java

    r871 r904  
    127127 
    128128    static Templates xsltDiffx2Wml; 
     129     
     130        /** 
     131         * org/docx4j/diff/diffx2wml.xslt will be used by default 
     132         * to transform the diff output into a Word docx with tracked 
     133         * changes. This method allows you to use your own xslt  
     134         * instead. 
     135         * @param xsltDiffx2Wml 
     136         */ 
     137        public static void setXsltDiffx2Wml(Templates xsltDiffx2Wml) { 
     138                Differencer.xsltDiffx2Wml = xsltDiffx2Wml; 
     139        } 
     140     
     141     
     142     
    129143    static Templates xsltMarkupInsert; 
    130144    static Templates xsltMarkupDelete; 
     
    317331                         
    318332                        XMLInputFactory inputFactory = XMLInputFactory.newInstance(); 
     333                        /* 
     334                         * With JDK 1.5, you need to supply a stax jar, or you 
     335                         * will get: 
     336                         *  
     337                         * javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found 
     338                                at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72) 
     339                                at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176) 
     340                                at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92) 
     341                                at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)  
     342                                 
     343                         * This is not necessary if you use Java 6.  
     344                         *  
     345                         * From http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP4.html 
     346                         *  
     347                         * The XMLInputFactory class lets you configure implementation instances of XML  
     348                         * stream reader processors created by the factory. New instances of the abstract  
     349                         * class XMLInputFactory are created by calling the newInstance() method on the  
     350                         * class. The static method XMLInputFactory.newInstance() is then used to create  
     351                         * a new factory instance. 
     352 
     353                                Deriving from JAXP, the XMLInputFactory.newInstance() method determines the  
     354                                specific XMLInputFactory implementation class to load by using the following  
     355                                lookup procedure: 
     356                                 
     357                                   1. Use the javax.xml.stream.XMLInputFactory system property. 
     358                                    
     359                                   2. Use the lib/xml.stream.properties file in the JRE directory. 
     360                                    
     361                                   3. Use the Services API, if available, to determine the classname  
     362                                   by looking in the META-INF/services/javax.xml.stream.XMLInputFactory  
     363                                   files in jars available to the JRE. 
     364                                    
     365                                   4. Use the platform default XMLInputFactory instance. 
     366                         *  
     367                         */ 
     368                         
     369                         
    319370                        //java.io.InputStream is = new java.io.ByteArrayInputStream(naive.getBytes("UTF-8")); 
    320371                        Reader reader; 
     
    13001351                } 
    13011352        } 
     1353 
    13021354     
    13031355 
Note: See TracChangeset for help on using the changeset viewer.