2013-03-21 95 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 
相關問題