XSLT2.0 processor for Perl?

老子叫甜甜 提交于 2020-01-14 09:31:26

问题


Is there any robust XSLT2.0 processor for Perl? I just tried out XML::LibXSLT and it doesn't support analyze-string, regex, etc. I'm afraid of using XML::Saxon::XSLT2 for my work cause it uses Java and I wouldn't want to add that to my list of dependencies. What library do you guys use for XSL2.0 transformations?

Cheers,


回答1:


So you're looking for an XSLT 2.0 processor written in Perl?

No, you most definitely do not want a pure-Perl XSLT processor. The result would be excruciatingly slow and memory intensive, not to mention you want a library that's been thoroughly tested in the field by a much larger user base than the comparatively few people that do XSLT in Perl. That's why LibXSLT is so popular, since it's a fast and solid C library with a minimal Perl wrapper around it. And unless you're using a GUI debugger like Komodo with breakpoints and variable inspection, debugging isn't really much more complicated.

But to answer your question: The only fully compliant XSLT 2.0 processor available today is Saxon, available as a fully featured commercial Java library and a stripped-down open source version – both incidentally made by the same guy who wrote the XSLT 2.0 spec (I wonder which were written first?). Given the complexity of the spec, it seems likely to remain that way for a long time.

So, if using a Java library is undesirable, perhaps you should ask yourself whether you really need the complete 2.0 feature list or would be content with using some of the other libraries that slowly and painfully are underway to implementing "XSLT 1.5".



来源:https://stackoverflow.com/questions/4496515/xslt2-0-processor-for-perl

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