How to encode data of XSLT stylesheet

久未见 提交于 2019-12-11 10:57:29

问题


I have generated an XSLT stylesheet which converts an XML file to an ePub. I use saxon9.jar to convert the XML using XSLT. Now I need to know whether I can make the XSLT code binary. Is it possible using java, so that I can generate a jar file which converts the XML to ePub using saxon, provided that the content of XSLT file is not readable.


回答1:


The problem got resolved after I read this page: http://saxon.sourceforge.net/saxon7.6/using-xsl.html#Compiling




回答2:


One possibility would be to use Xalan-J XSLTC - https://xml.apache.org/xalan-j/xsltc_usage.html. Of course this is a different XSLT engine than Saxon ... and it appears that Xalan-J only supports XSLT-1.0 / XPATH-1.0.

I'm not sure, but it appears that Saxon-EE supports compilation of stylesheets to bytecode. Saxon-EE not a free product though.




回答3:


If you want to obfuscate a stylesheet with Saxon you need the EE or PE edition, see http://www.saxonica.com/documentation/index.html#!using-xsl/packaged-xslt, to create the obfuscated stylesheet. You can then run it however with Saxon HE.



来源:https://stackoverflow.com/questions/18919835/how-to-encode-data-of-xslt-stylesheet

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