2013-03-21 2 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

9

Не полный ответ, реальный номер версии можно найти, глядя на включают 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.

+0

Привет, Винсент, что делать, если у меня нет файла xmlversion.h? Я пробовал делать «find/usr -name xmlversion.h», и он ничего не возвращал. Спасибо – rockhammer

+0

@rockhammer, тогда вам нужно установить пакет libxml2-devel. – Lucas

21

Другим вариантом является запуск xmllint и xsltproc с --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 и 0.8.17 libexslt.

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 
Смежные вопросы