Re: XML, XPATH in Centos?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, 8 Dec 2006 14:52:17 +0100
"Christian Nygaard" <christiannygaard@xxxxxxxxx> wrote:
> What built in utilities are there that can evaluate XML XPath statements in
> CentOS?

libxml2 has XPath support. Bindings against libxml2 are provided by
many languages, e.g. you could install the libxml2-python package from
CentOS 4. Besides that, it is relatively easy to write a C program that
uses libxml2 to evaluate XPath expressions (which is handy for shell
scripting). A quick and dirty example can be found at:

http://danieldk.org/code/snippets/xpgrep-0.0.1.tar.gz

(I wrote/use it as a minimal grep workalike that accepts XPath
expressions).

BTW. If you have files that are not well-formed (like many XHTML)
files, or if the information to extract is trivial, it is often easier
to grep or write a simple line-processing Perl script.

-- Daniel
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux