Revision [282]

This is an old revision of CommandXpath made by DavidLee on 2008-10-25 11:44:41.


Command xpath


xpath evaluate an XPATH expression and print the result


xpath [-f xpath-file] [-i input-file] [-n] [-q] xpath-expr [-v name value [name value ...]]


-f xpath-file read xpath expression from file
-i input use input as the source xml document, otherwise stdin
if input is an XML expression then use it directly (dont treat as filename).
-n do not use a source context
[-q] xpath-expr xpath expression

-v Read remaining pairs of arguments as name/value pairs to assign as xpath variables

Note that the "-q" is optional. It is only required if you need to specify both -n and -v
xpath-n -q expr -v variable some-value


$ xls | xpath '//file[1]/@name'

Return Value

Returns 0 if the the xpath expression executed successfully and a non-empty result is returned. otherwise 1


There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki