2013-03-21 234 views

回答

5

在我的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/[email protected] -> libxml2.2.dylib 
+0

够简单。谢谢!我正在用更多的手册页或-v/- 版本的方式来思考它,但这也是有道理的。 – Spanky 2013-03-21 18:28:03

9

不是一个完整的答案,可以发现真正的版本号,看有发现里面/usr/include/libxml2/libxmlxmlversion.h

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。

+0

嗨文森特,如果我没有xmlversion.h文件呢?我试着做“find/usr -name xmlversion.h”,它没有返回任何东西。谢谢 – rockhammer 2014-04-22 18:52:26

+0

@rockhammer,那么你需要安装libxml2-devel软件包。 – Lucas 2014-07-10 15:59:05

21

另一种选择是与--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,1.1.28的libxslt和libexslt 0.8.17。

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 
相关问题