15

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

提前致谢!

4

4 回答 4

25

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

$ 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。

于 2013-12-29T11:08:28.923 回答
12

不是一个完整的答案,可以通过查看包含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。

于 2013-12-29T10:40:24.647 回答
8

在我的 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
于 2013-03-21T17:36:16.967 回答
1

在 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
于 2015-01-26T10:01:45.950 回答