是否可以/轻松升级PHP库以使用XSLT 2.0?
目前的设置:
xsl
XSL enabled
libxslt Version 1.1.24
libxslt compiled against libxml Version 2.6.32
EXSLT enabled
libexslt Version 1.1.24
Run Code Online (Sandbox Code Playgroud) 我正在试图找出我目前安装的版本.OS X Mountain Lion(10.8.2)
提前致谢!
我认识到这是一个重复的问题,但是我发现与此问题有关的所有其他答案似乎都没有帮助我......
我正在安装GitLab并运行gem依赖项,当它达到NokoGirigem要求时失败并显示以下信息:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
extconf.rb:10:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:10:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:11:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc()... -lxml2
checking for xsltParseStylesheetDoc()... -lxslt
-----
libxslt is missing. please …Run Code Online (Sandbox Code Playgroud) 我无法在Heroku上安装XML :: LibXSLT.尽管在Heroku stack cedar和cedar-14中列出了已安装的Ubuntu软件包,但看起来并没有安装所需的库.在这个问题中已经报告了类似的问题,但是没有在Heroku上报告,并且不允许安装新的Ubuntu软件包.gdbm
要重现错误,请创建一个最小的存储库,需要XML :: LibXSLT cpanfile:
$ git init
$ echo 'requires "XML::LibXSLT";' > cpanfile
$ echo 'sub { [200,[], ['Hello World']] }' > app.psgi
$ git add cpanfile app.psgi
$ git commit -m "initial commit"
Run Code Online (Sandbox Code Playgroud)
使用heroku-buildpack-perl创建一个新的Heroku应用程序来运行cpanm:
$ heroku create --stack cedar --buildpack https://github.com/miyagawa/heroku-buildpack-perl.git
$ git push heroku master
Run Code Online (Sandbox Code Playgroud)
错误日志包含
! Installing XML::LibXSLT failed. See /app/.cpanm/work/1412752363.1663/build.log for details. Retry …Run Code Online (Sandbox Code Playgroud) 我最近将我的 mac-os 更新为 Mojave。我正在使用 Nginx,它在我以前的操作系统上运行,但在更新到 Mojave 后,我无法启动我的 Nginx。所以我尝试再次安装它,首先,它给了我 c 编译器错误,所以我下载了 Xcode 命令行工具,它消失了。现在它给了我找不到 libxml2/libxslt 库。我尝试使用 brew 安装它,但仍然出现相同的错误。我不确定出了什么问题。
我已经使用 brew install 下载了 libxml2 和 libxslt。
我的配置脚本。
./configure \
--prefix=/opt/nginx/$NGINX_NAME_VERSION \
--pid-path=/var/run/nginx.pid \
--conf-path=/etc/nginx/$NGINX_NAME_VERSION/conf/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--lock-path=/var/lock/nginx.lock \
--http-client-body-temp-path=/var/tmp/nginx/body \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-scgi-temp-path=/var/tmp/nginx/scgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--with-debug \
--with-http_addition_module \
--with-http_dav_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-mail \
--with-mail_ssl_module \
--with-cc-opt=-I/usr/local/opt/openssl/include \
--with-ld-opt=-L/usr/local/opt/openssl/lib \
--builddir=$NGINX_BUILD_PATH
Run Code Online (Sandbox Code Playgroud)
错误 :
checking …Run Code Online (Sandbox Code Playgroud) 在python 2.6中,我这样做是为了实现xsl转换
import libxml2
import libxslt
...
styledoc = libxml2.parseFile(my_xslt_file)
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseDoc(siri_response_data)
result = style.applyStylesheet(doc, None)
...
Run Code Online (Sandbox Code Playgroud)
Python 3.2中的等价物是什么?
我问,因为似乎lnxml和libxslt在python3.2中不可用.我听说过lxml - 这是libxml2 + libxslt的直接等价物还是有不同的调用模式(需要重写代码)?
看起来像libxslt不支持XSLT 2.0,和xsl:result-document.有没有办法模仿xsl:result-document使用libxslt,或xsltproc?
有没有人Regexp在libxslt工作?什么时候,怎么样?
http://www.exslt.org/regexp/index.html
当使用xsltproc --dumpextensions带有最新libxslt 的命令时,我没有获得任何Regexp支持:-(
我有一套以前工作正常的XSLT样式表.最近,一位开发人员将我们的Perl升级到了更新的版本.从那时起,我们一直在获得间歇性的样式表编译错误,其中定义了EXSLT函数.
以下是错误的示例:
元素参数只允许在模板,变量或参数中使用
该变量在EXSLT函数中定义.一旦收到错误,每次我尝试访问我的网页时都会收到错误,直到我重新启动Apache(与mod_perl一起使用).重新启动后,我可以调用XML :: LibXSLT和EXSLT函数的网页正常显示,但重新加载页面将再次触发错误.
阅读XML :: LibXSLT文档后,我确认HAVE_EXSLT()函数返回值1.我当前的XML :: LibXSLT版本是1.79.我的LibXSLT DLL是1.1.28.我的perl版本是5.14.3.以前的版本分别是5.8.8,1.66和1.1.22.
为什么我以前没有看到这些错误?下面是样式表中引发编译错误的开始片段.如果有任何其他有用的信息,请告诉我.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:func="http://exslt.org/functions"
xmlns:dtbl="http://docbook.sourceforge.net/dtbl"
extension-element-prefixes="func"
exclude-result-prefixes="exsl func dtbl"
version="1.0">
<func:function name="dtbl:convertLength">
<xsl:param name="arbitrary.length"/>
Run Code Online (Sandbox Code Playgroud)
其他发现:
在我最初发布这个问题之后,我发现如果我使用普通的旧CGI而不是mod_perl,我根本无法重现错误.另外,我在Apache httpd.conf中找到了以下行.在评论它时,我看到错误发生的频率急剧下降,尽管它没有完全消除错误.
PerlModule XML::LibXSLT;
Run Code Online (Sandbox Code Playgroud) 当我运行Perl脚本时,我得到了
Can't locate XML/LibXSLT.pm in @INC
所以我尝试这样做cpan:
cpan> install XML::LibXSLT CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Fri, 02 Oct 2009 13:28:24 GMT Running install for module XML::LibXSLT Running make for P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /root/.cpan/sources/authors/id/P/PA/PAJAS/XML-LibXSLT-1.68.tar.gz ok Scanning cache /root/.cpan/build for sizes XML-LibXSLT-1.68/ XML-LibXSLT-1.68/perl-libxml-mm.h XML-LibXSLT-1.68/t/ XML-LibXSLT-1.68/t/08literal.t XML-LibXSLT-1.68/t/09exslt.t XML-LibXSLT-1.68/t/02dromeds.t XML-LibXSLT-1.68/t/01basic.t XML-LibXSLT-1.68/t/14security.t XML-LibXSLT-1.68/t/12import.t XML-LibXSLT-1.68/t/05quick.t XML-LibXSLT-1.68/t/03input.t XML-LibXSLT-1.68/t/13error.t XML-LibXSLT-1.68/t/11utf8.t XML-LibXSLT-1.68/t/04params.t XML-LibXSLT-1.68/t/06entities.t XML-LibXSLT-1.68/t/06output.t XML-LibXSLT-1.68/t/07blankdoc.t XML-LibXSLT-1.68/t/10functions.t XML-LibXSLT-1.68/testcases/ XML-LibXSLT-1.68/testcases/default.conf XML-LibXSLT-1.68/Changes XML-LibXSLT-1.68/example/ XML-LibXSLT-1.68/example/1.xsl XML-LibXSLT-1.68/example/2.xsl …
我正在尝试在Enthought Canopy中运行python-docx。我在VMWare Worstation 10上运行Ubuntu 14.04。每当我尝试从lxml导入docx或导入etree时,都会收到一个似乎与libxml2库有关的错误:
ImportError: /usr/lib/x86_64-linux-gnu/libxslt.so.1: symbol xmlBufUse, version LIBXML2_2.9.0 not defined in file libxml2.so.2 with link time reference
Run Code Online (Sandbox Code Playgroud)
我四处查看,发现另一个人也遇到类似的错误,然后按照指示进行操作。仍然没有运气。然后我意识到我的计算机上有libxml2版本2.9.1。
这是否意味着我需要获取旧版本的libxml2 2.9.0,还是有其他问题?我可以使用apt-get找到2.9.1,但找不到2.9.0。在踏上这条路之前,我认为这里的某个人可能会有更好的主意。
谢谢!
我正在尝试使用CMake检查系统是否已xsltproc安装,以及它是否来自libxslt版本 1.1.27 或更高版本。(早期版本中有一个我不想解决的错误。)
当您运行时xsltproc --version,您会得到如下输出:
Using libxml 20900, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20900, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20900
libexslt 817 was compiled against livxml 20900
Run Code Online (Sandbox Code Playgroud)
我编写了这个 CMake 代码来解析第一行中的第二个整数,并尝试将其与 10127 进行比较,这应该告诉我是否有足够新的版本xsltproc:
execute_process(COMMAND xsltproc --version
OUTPUT_VARIABLE XSLTPROC_VERSION ERROR_QUIET)
if(XSLTPROC_VERSION)
string(REGEX MATCH "libxslt [0-9]+" LIBXSLT_VERSION
${XSLTPROC_VERSION})
if(LIBXSLT_VERSION LESS 10127) # Always succeeds! Why?
message(STATUS "xsltproc found, but it's …Run Code Online (Sandbox Code Playgroud) 我尝试安装perl模块XML :: LibXSLT但它失败了.谷歌搜索了几个小时,但没有任何帮助所以我发布这个.也许有人可以帮忙!提前致谢!
cpan XML::LibXSLT
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Mon, 28 Oct 2013 11:08:37 GMT
Running install for module 'XML::LibXSLT'
CPAN: YAML loaded ok (v0.84)
Running make for S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.062)
Checksum for /root/.cpan/sources/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.81.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.58)
XML-LibXSLT-1.81/
XML-LibXSLT-1.81/perl-libxml-mm.h
XML-LibXSLT-1.81/benchmark/
XML-LibXSLT-1.81/benchmark/Driver/
XML-LibXSLT-1.81/benchmark/Driver/Sablotron.pm
XML-LibXSLT-1.81/benchmark/Driver/LibXSLT.pm
XML-LibXSLT-1.81/benchmark/Driver/BaseClass.pm
XML-LibXSLT-1.81/benchmark/benchmark.pl
XML-LibXSLT-1.81/Changes
XML-LibXSLT-1.81/LibXSLT.pm
XML-LibXSLT-1.81/MANIFEST
XML-LibXSLT-1.81/testcases/
XML-LibXSLT-1.81/testcases/default.conf
XML-LibXSLT-1.81/example/
XML-LibXSLT-1.81/example/fatal.xsl
XML-LibXSLT-1.81/example/2.xml
XML-LibXSLT-1.81/example/bad3.xsl
XML-LibXSLT-1.81/example/nonfatal.xsl
XML-LibXSLT-1.81/example/1.xml
XML-LibXSLT-1.81/example/bad2.xsl
XML-LibXSLT-1.81/example/1.xsl
XML-LibXSLT-1.81/example/2.xsl
XML-LibXSLT-1.81/example/bad1.xsl …Run Code Online (Sandbox Code Playgroud) libxslt ×13
libxml2 ×4
perl ×4
xslt ×4
apache ×1
binding ×1
cmake ×1
comparison ×1
cpan ×1
exslt ×1
gem ×1
gitlab ×1
heroku ×1
integer ×1
lxml ×1
macos ×1
macos-mojave ×1
mod-perl ×1
nginx ×1
nokogiri ×1
php ×1
python ×1
python-3.x ×1
python-docx ×1
regex ×1
ruby ×1
string ×1
xml ×1
xslt-2.0 ×1