【问题标题】:How can I tell what version of libxml2 and libxslt are installed on OS X?我如何知道 OS X 上安装了哪个版本的 libxml2 和 libxslt?
【发布时间】:2013-03-21 17:33:13
【问题描述】:

我正在尝试找出我当前安装的版本。 OS X 山狮 (10.8.2)

提前致谢!

【问题讨论】:

    标签: macos libxml2 libxslt


    【解决方案1】:

    另一种选择是使用--version 标志运行xmllintxsltproc

    $ xmllint --version
    xmllint: using libxml version 20900
       compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib
    $ 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 libxml 20900
    

    这意味着我正在运行 libxml2 2.9.0、libxslt 1.1.28 和 libexslt 0.8.17。

    【讨论】:

    • xmllint --version 也适用于 Ubuntu linux。
    【解决方案2】:

    不是一个完整的答案,真正的版本号可以通过查看包括xmlversion.h/usr/include/libxml2/libxml中找到:

    Mac-mini-de-Vincent:libxml Vincent$ grep -Ri "LIBXML_DOTTED_VERSION" xmlversion.h
    xmlversion.h:#define LIBXML_DOTTED_VERSION "2.9.0"
    

    所以在我的系统(10.9.1)上,libxml2 的版本是 2.9.0。

    【讨论】:

    • 嗨文森特,如果我没有 xmlversion.h 文件怎么办?我尝试执行“find /usr -name xmlversion.h”,但它没有返回任何内容。谢谢
    • @rockhammer,那么你需要安装libxml2-devel包。
    • @rockhammer 如果您在 Mac 上使用 Xcode,请尝试 find /Applications/Xcode.app -name xmlversion.h。它可以在其中一个嵌入式 SDK 中找到。
    【解决方案3】:

    在我的 10.8.3 系统上是 2.2:

    > ls -l /usr/lib/libxml*
    -rwxr-xr-x  1 root  wheel  2390032 Mar  2 17:18 /usr/lib/libxml2.2.dylib*
    lrwxr-xr-x  1 root  wheel       15 Mar  2 17:21 /usr/lib/libxml2.dylib@ -> libxml2.2.dylib
    

    【讨论】:

    • 很简单。谢谢!我更多地是以手册页或 -v/--versions 的方式来考虑它,但这也是有道理的。
    • 我很确定这意味着它是 lbxml2 版本 2.something。不是很有用
    • 这是 libxml 2.2 版。
    【解决方案4】:

    在 10.8.5 中:

    $ /usr/bin/xmllint --version
    /usr/bin/xmllint: using libxml version 20708
       compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid
    HTML Legacy C14N Catalog XPath XPointer XInclude ISO8859X Unicode Regexps Automata Expr
    Schemas Schematron Modules Debug Zlib 
    
    $ /usr/bin/xsltproc --version
    Using libxml 20708, libxslt 10126 and libexslt 815
    xsltproc was compiled against libxml 20708, libxslt 10126 and libexslt 815
    libxslt 10126 was compiled against libxml 20708
    libexslt 815 was compiled against livxml 20708
    

    【讨论】:

      猜你喜欢
      • 2010-09-12
      • 1970-01-01
      • 2011-09-12
      • 1970-01-01
      • 2015-08-10
      • 2021-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多