How can I tell what version of libxml2 and libxslt are installed on OS X?
Asked Answered
M

4

17

I'm trying to find out what version I currently have installed. OS X Mountain Lion (10.8.2)

Thanks in advance!

Monroemonroy answered 21/3, 2013 at 17:33 Comment(0)
K
9

On my 10.8.3 system it's 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
Karlenekarlens answered 21/3, 2013 at 17:36 Comment(3)
Simple enough. Thanks! I was thinking of it in more of a man page or -v/--versions manner, but this makes sense, too.Monroemonroy
I'm pretty sure that means it's lbxml2 version 2.something. Not very usefulSandstorm
It's libxml version 2.2.Karlenekarlens
M
26

Another option is to run xmllint and xsltproc with the --version flag:

$ 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

This means I'm running libxml2 2.9.0, libxslt 1.1.28, and libexslt 0.8.17.

Moniquemonism answered 29/12, 2013 at 11:8 Comment(1)
xmllint --version works on Ubuntu linux, too.Clough
S
14

Not a complete answer, the real version number can be found looking at include xmlversion.h found inside /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"

So on my system (10.9.1), the libxml2 version is 2.9.0.

Seisin answered 29/12, 2013 at 10:40 Comment(3)
Hi Vincent, what if I don't have the xmlversion.h file? I tried doing "find /usr -name xmlversion.h" and it did not return anything. ThanksMockery
@rockhammer, then you need to install the libxml2-devel package.Cower
@Mockery If you are using Xcode on a Mac, then try find /Applications/Xcode.app -name xmlversion.h. It will be found in one of the embedded SDKs.Lancey
K
9

On my 10.8.3 system it's 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
Karlenekarlens answered 21/3, 2013 at 17:36 Comment(3)
Simple enough. Thanks! I was thinking of it in more of a man page or -v/--versions manner, but this makes sense, too.Monroemonroy
I'm pretty sure that means it's lbxml2 version 2.something. Not very usefulSandstorm
It's libxml version 2.2.Karlenekarlens
F
2

In 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
Faso answered 26/1, 2015 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.