如何判断OS X上安装了哪个版本的libxml2和libxslt?

Spa*_*nky 13 macos libxml2 libxslt

我正在试图找出我目前安装的版本.OS X Mountain Lion(10.8.2)

提前致谢!

nwe*_*hof 22

另一个选择是运行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
Run Code Online (Sandbox Code Playgroud)

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


小智 10

不是一个完整的答案,真正的版本号可以找到包含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"
Run Code Online (Sandbox Code Playgroud)

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


pau*_*kow 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
Run Code Online (Sandbox Code Playgroud)