39

What tools are you guys using for XPath and why? Right now I'm using

SketchPath seems to stand out the most to me because it actually helps you create the xpath and it is very advanced. If you haven't tried it you should.

Cons to SketchPath: you have to install it on the machine, otherwise it is fantastic.

Cons to WhiteBeam: you have to upload your file which I don't always want to do for security reasons and the file size you can upload has some limit on it, and uploading a file is annoying anyways. Also I think there might be some subtle differences between the xpath used for that tool and when running a .NET app. But don't remember any right now. Just keep it in mind.

Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • Do you mean as a tool for designing XPath expressions or as a tool for searching XML documents using XPath as the query language? – U62 Jan 02 '10 at 15:20
  • Update on SketchPath: Its still freeware, but its now accompanied by a payware product, CoherentWeb. This handles much larger XML files (up to 10MB) and loads XML 20 x faster. It can 'browse' up to 10,000 files and is integrated with a bulk XSLT processing tool. – pgfearo Feb 19 '10 at 15:18
  • I just tried SketchPath, and I find the interface incredibly unintuitive. Lots of unfamiliar screen elements. I tried to use it on a large (30Mb) XML file, and get "Xml exception at: 1 - Data at the root level is invalid. Line 1, position 1." - hard to tell what the cause is though. – Steve Bennett Jun 08 '11 at 05:09
  • SketchPath has now been dropped as a standalone product, its features live on in CoherentWeb. – pgfearo Aug 16 '11 at 21:15
  • CoherentWeb also dropped (see the pattern?)...but i've added a simple online XPath2.0 editor in its wake, has SketchPath's trace feature but no autocomplete yet: http://www.qutoric.com/xslt/analyser/xpathtool.html – pgfearo Oct 06 '12 at 21:56

6 Answers6

46

[Update] XMLQuire was originally recommended in this answer. It was a free XML editor for Windows with the SketchPath XPath Editor built in for XPath testing.

XMLQuire has not been maintained for a few years and has now been retired.

For XPath experimentation etc. XMLQuire's author now recommends the XPath Notebook extension for Visual Studio Code. Developed by the same author, this now supports XPath 3.1 courtesy of Saxonica's Saxon-JS processor.

enter image description here

pgfearo
  • 2,087
  • 1
  • 22
  • 27
  • Thanks for your excellent work. It's really worthy to mention that how to bring up the "Xpath Editor", I almost give up this invaluable utility just because I cannot manually edit an Xpath. :-) – zhaorufei Nov 05 '12 at 03:17
  • 1
    Thanks @pgfearo this is a really nice tool. – Fishcake Feb 11 '13 at 11:57
  • 1
    Useful tool but has an annoying System Modal dialog when entering XPath query. Also would be useful to allow expanding multi-line text area for entering XPath query. – David Clarke Mar 25 '13 at 21:27
  • @DavidClarke Will see what I can do for the next release. In the mean time there's also [Pathenq](http://www.qutoric.com/xslt/analyser/xpathtool.html) - an online XPath 2.0 tool I maintain. – pgfearo Mar 25 '13 at 23:33
  • Thanks Philip, appreciate the quick response. – David Clarke Mar 26 '13 at 00:26
  • 1
    This program does not handle large files. 50mb = OutOfMemoryException – Talon Jun 18 '13 at 06:15
  • 1
    It's crap, it doesn't let you search XPath – CodyBugstein Jan 15 '14 at 23:09
  • As the author of XMLQuire, the plan is to retire this in mid 2021 and replace it with the [Visual Studio Code XPath 3.1 Notebook extension](https://github.com/pgfearo/vscode-nodebook) - currently a Work in Progress. – pgfearo Feb 22 '21 at 07:13
  • XMLQuire has now been retired and replaced by a VS Code extension. I've updated the answer to reflect this. – pgfearo Aug 02 '21 at 11:02
13

If you're in a web dev environment, Firefox has a number of great tools for XPath support and analysis:

  • Firebug has built-in XPath support
  • XPath Checker I have found to be great

and also maybe of use:

  • XPath Runner
  • FireXPath

Be careful with Firebug - the right-click "copy XPath" command copies the path as all lower-case, and some XML parsers (like the MXSML parser used in FinalBuilder) are case-sensitive - so you'll need to correct the casing of your Firebug-copied XPath statement otherwise your parser won't find any matching nodes.

Dylan Beattie
  • 53,688
  • 35
  • 128
  • 197
Richard H
  • 38,037
  • 37
  • 111
  • 138
6

with this xpath tester you can test standard XPath expressions

You can also save your XPath's and XMLs at any point of time to return to it later or post a link in web or email, which is a really handy feature.

user431529
  • 2,222
  • 1
  • 17
  • 16
  • 1
    Seems that it won't work with namespaces. Tried {http://www.w3.org/2005/Atom}entry and got nothing whereas in code, I got values. Anyone else had better luck? – csharpforevermore May 31 '12 at 14:37
4

SketchPath is the best tool for XPath that I have used so far. I have used oXygen as well, but prefer SketchPath to oXygen for XPath.

3

I like XPather, a Firefox plugin. It's simple and easy-to-use and it's not a separate program to run as long as you have Firefox running which is when and where I'm usually using XPath.

jamesaharvey
  • 14,023
  • 15
  • 52
  • 63
1

I use oXygen for xpath work. It's rather easy to test your expression against xml on file. You set the target xml file once and then it's just a button to click to test your expression.

NA.
  • 6,451
  • 9
  • 36
  • 36