Can we do XSLT 2.0 with Netbeans 7?

夙愿已清 提交于 2019-12-10 11:29:30

问题


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

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



来源:https://stackoverflow.com/questions/6315260/can-we-do-xslt-2-0-with-netbeans-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!