Re: [xml] Which XPATH syntax does xmlstarlet support?
- From: Noam Postavsky <npostavs users sourceforge net>
- To: Andrew Pennebaker <andrew pennebaker gmail com>
- Cc: libxml <xml gnome org>
- Subject: Re: [xml] Which XPATH syntax does xmlstarlet support?
- Date: Sun, 26 Apr 2015 18:27:58 -0400
On Thu, Apr 23, 2015 at 8:04 PM, Andrew Pennebaker
<andrew pennebaker gmail com> wrote:
When I try to hand xmlstarlet the same XPATH query syntax I use in Chrome
and Firefox, xmlstarlet never seems to find any results.
FYI, xmlstarlet uses libxml and libxslt, but a separate project
(unlike xmllint which comes with libxml), hosted on Sourceforge:
http://sourceforge.net/projects/xmlstar/.
Is there a document
detailing the idiosyncrasies of xmlstarlet XPATH vs WebKit XPATH, so that I
know how to convert my browser queries into xmlstarlet-compatible queries?
I think both xmlstarlet (via libxml) and WebKit purport to implement
http://www.w3.org/TR/xpath/, so there should be no serious deviations.
While xmllint provides an --xpath option which take only an XPath
query, xmlstarlet takes XPath queries as parts of other somewhat more
complicated options, so there are more things to get wrong. The most
common reason for XPaths not matching is the namespace thing, see
http://xmlstar.sourceforge.net/doc/UG/ch05.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]