Parse XML files

Hi
Is xpath available in OpenWrt, or any other parsing tool for XML files?

/mrhaav

libxml2 should provide XML parsing.

1 Like

I think I was not clear about what I need:
I need some kind of XML parser I can use in ash.

I don´t understand how to use libxml2 in ash.

Python is available for OpenWRT in some flavors: https://openwrt.org/docs/guide-user/services/python

handing over to a mini Python script could do the deed.

I installed libxml2, but I still get -ash: xmllint: not found when I run xmllint --help. Shouldn´t xmllint be available in libxml2?

Use a pre-release or a fresh build:

1 Like

As @vgaetera has mentioned, it looks like the current version of libxml2 in 19.07 branch does not copy some of the helper binaries, however the version in 21.02 and snapshot does, you could download the libxml2 package from 21.02 RC/snapshot for your arch from here:

https://downloads.openwrt.org/releases/21.02.0-rc4/packages/
https://downloads.openwrt.org/snapshots/packages/

Then install with opkg.

2 Likes

Downloaded and installed:
libxml2_2.9.12-1_x86_64.ipk
libxml2-utils_2.9.12-1_x86_64.ipk

Now xmllint works from command line. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.