سؤال

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?

هل كانت مفيدة؟

المحلول

How to make Saxon the JRE-installation-default XSLT Processor:

(So not only for Netbeans, other Java applications might be impacted as well.)

  1. Get Saxon for Java (there are different editions, pick the one suitable for you) and copy saxonXYZ.jar to the jre/lib/ext dir.
  2. In the jre/lib dir create a jaxp.properties file with following content:

    javax.xml.transform.TransformerFactory = net.sf.saxon.TransformerFactoryImpl

  3. (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).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top