Allow specifying concrete imlementation of the TransformerFactory
-----------------------------------------------------------------

                 Key: MOJO-777
                 URL: http://jira.codehaus.org/browse/MOJO-777
             Project: Mojo
          Issue Type: New Feature
          Components: xml
            Reporter: Aleksei Valikov
            Assignee: Jochen Wiedmann


Currently, when retrieving the instance of TransformerFactory, the plugin 
relies on the standard JAXP mechanism.
Unfortunately, this mechanism is unpredictable in many environments.

Let's see the docs on TransformerFactory.newInstance():

* Use the javax.xml.transform.TransformerFactory system property.
* Use the properties file "lib/jaxp.properties" in the JRE directory. This 
configuration file is in standard java.util.Properties format and contains the 
fully qualified name of the implementation class with the key being the system 
property defined above. The jaxp.properties file is read only once by the JAXP 
implementation and it's values are then cached for future use. If the file does 
not exist when the first attempt is made to read from it, no further attempts 
are made to check for its existence. It is not possible to change the value of 
any property in jaxp.properties after it has been read for the first time.
* Use the Services API (as detailed in the JAR specification), if available, to 
determine the classname. The Services API will look for a classname in the file 
META-INF/services/javax.xml.transform.TransformerFactory in jars available to 
the runtime.
* Platform default TransformerFactory instance.

Number 1 is allright.
Number 2 is user environment dependent.
Number 3 is unpredictable. There can be several JARs in the classpath defining 
the META-INF/services/javax.xml.transform.TransformerFactory resource file. In 
this case which factory will be instantiated is not predictable and depends on 
the order of the JARs in the classpath.
Number 3 is allright.

So numbers 2 and 3 introduce undeterministic behaviour.  Some of my builds 
suffered from this unpredictability: I tried to use Saxon 8.x as the processor 
in my builds. Sometimes Xalan was used, sometimes Saxon - and there was no way 
for me to specify the exact processor to be used.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to