问题
In its current form, Netbeans only supports XSLT 1.0 and does not support XSLT 2.0.
How do we use XSLT 2.0 with Netbeans 7?
回答1:
How to make Saxon the JRE-installation-default XSLT Processor:
(So not only for Netbeans, other Java applications might be impacted as well.)
- Get Saxon for Java (there are different editions, pick the one suitable for you) and copy saxonXYZ.jar to the jre/lib/ext dir.
In the jre/lib dir create a jaxp.properties file with following content:
javax.xml.transform.TransformerFactory = net.sf.saxon.TransformerFactoryImpl
(Restart Netbeans.) Check success by doing an XSL Transformation: If Saxon has been used the XSLT Processor output will contain "Using net.sf.saxon.Controller XSLT processor from file ..."
[Tested with NetBeans 7.3.1 / Saxon-HE 9.4.0 / JRE 1.7.0_17]
There are other ways of configuring the "TransformerFactory" used in a Java application. See the JAXP FAQ. And of course, there are also other XSLT processors than Saxon that plug into the Java API for XML Processing (JAXP).
来源:https://stackoverflow.com/questions/6315260/can-we-do-xslt-2-0-with-netbeans-7