简体   繁体   English

xmlXPathCompOpEval:找不到功能节点集

[英]xmlXPathCompOpEval: function node-set not found

I'm implementing several libraries(libxslt, libxml2, libexslt) for XSLT Processing in my program. 我正在为程序中的XSLT处理实现几个库(libxslt,libxml2,libexslt)。 I included the header files and .so files to link the libraries to the program, and found out that the linking worked well. 我包含了将文件库链接到程序的头文件和.so文件,并发现链接效果很好。

Below is the code using some functions of the library to realize XSLT Processing in my program, and as a result the first two line worked well but an error was generated on the last line. 下面是使用该库的某些功能在我的程序中实现XSLT处理的代码,因此,前两行运行良好,但最后一行产生了错误。

style=xsltParseStylesheetFile(stylesheetfile);
input=xmlParseFile(inputfile);
output=xsltApplyStylesheet(style, input,0); //error

//error //错误
xmlXPathCompOpEval : function node-set not found xmlXPathCompOpEval:找不到功能节点集
XPath error : Unregistered function XPath错误:未注册的功能

The same XSLT processing worked well using xsltproc which is a command-line version of libxslt and the same XML(inputfile) and XSL files(stylesheetfile) in my computer, but the implementation won't work. 使用xsltproc(这是libxslt的命令行版本)以及我的计算机中相同的XML(inputfile)和XSL文件(stylesheetfile),相同的XSLT处理效果很好。但是,该实现无法正常工作。

I know that the node-set function is in libexslt. 我知道节点集功能在libexslt中。 But why won't it work? 但是为什么它不起作用? Is it the linking problem of the library? 是图书馆的链接问题吗? Especially libexslt? 尤其是libexslt? or configuration? 或配置? Do you guys know any solution of this error? 你们知道这个错误的任何解决方案吗? Would really appreciate your help. 非常感谢您的帮助。 Thank you. 谢谢。

The inclusion of headers and linking to the relevant libraries alone doesn't enable extension functions, as you mention xsltproc supporting them see the source code of it at https://gitlab.gnome.org/GNOME/libxslt/blob/master/xsltproc/xsltproc.c#L803 where it calls 仅包含头文件并链接到相关库并不能启用扩展功能,因为您提到了xsltproc支持它们,请参阅https://gitlab.gnome.org/GNOME/libxslt/blob/master/xsltproc的源代码。 /xsltproc.c#L803调用的位置

exsltRegisterAll();

to enable respectively register all EXSLT extension functions with the XSLT processor. 以分别向XSLT处理器注册所有EXSLT扩展功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM