Home Software Blog Wallpapers Webtools
XPath utility

Software listSoftware List

Delicious Bookmark this on Delicious

XPath utility

zip file Download file (23 KB) [Downloaded 413 times]


  • Look for matches in your xml content in one or several files
  • Select nodes using xpath and display them
  • Run additional xpaths on matched nodes to display multiple values

Usage help

  • Download the xpath.zip file, unzip it to any folder.
  • Open a command prompt window and view the help using "xpath -help"

Here are some examples which use the XML data below to explain how to use the utility:

<?xml version="1.0" encoding="utf-8" ?>
	<book title="2001 space odyssey" price="40">
			<author>Arthur C. Clarke</author>
	<book title="FREAKONOMICS - A Rogue Economist Explores the Hidden Side of Everything" price="10">
			<author>Steven D. Levitt</author>
			<author>Stephen J. Dubner</author>
	<book title="I, Robot" price="35">
			<author>Isaac Asimov</author>

1. Search for matches in a file which match a given xpath:

xpath -file books.xml -query "books/book/authors/author[text() = 'Arthur C. Clarke']" -select InnerText


Sample1 output

2. Search for matches in a file which match a given xpath and display multiple values:

xpath -file books.xml -query "books/book/authors/author[text()='Arthur C. Clarke']" -select Custom -custom "parent::authors/parent::book/@title;parent::authors/parent::book/@price" -errors


Sample2 output

3. Look for matches in all xml files under c:\temp\ and its subfolder having a particular condition:

xpath -file books.xml -query "books/book[@price > 30]" -select Match -errors


Sample3 output

Pre-requisite software