Click here to Skip to main content
15,884,353 members
Articles / Programming Languages / XML

Debugging XPath Queries

Rate me:
Please Sign up or sign in to vote.
4.14/5 (15 votes)
1 Dec 20031 min read 97K   2K   29   11
An application to visualize XPath Queries

Sample Image - screenshot.jpg

Introduction

This is a small application I wrote when I was stuck in front of an XPath query that I just couldn't understand. Took about an hour and a half to whip it up. The idea is to let you execute a query and see for yourself the results that are returned.

There are other tools that do it, but either they are Java based and require > 15 MB support libraries or they are web based (which I hate).

The Code

The application gets its input from one of two sources - a file or the clipboard, loads it into an XmlDocument and starts executing queries against it, showing you the result on the way.

I didn't built it to be performant or correct, just to do the job, so use it the next time you've XPath problems, and you'll like it. The other solution that I found was XmlSpy at 300$ +.

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.


Written By
United States United States
Hi, Been a member since 2003. Recent projects are a site about buying a car with bad credit and enjoying codeproject as usual.

Comments and Discussions

 
GeneralGenerating xpath add-on (quick and dirty) [modified] Pin
MikeEast16-Jan-08 22:24
MikeEast16-Jan-08 22:24 
Generalin VB.NET Pin
y2kvirus22-Aug-05 12:50
y2kvirus22-Aug-05 12:50 
GeneralWrong topic Pin
alerma14-Dec-03 21:48
alerma14-Dec-03 21:48 
GeneralGood job Pin
Bill Seddon9-Dec-03 21:21
Bill Seddon9-Dec-03 21:21 
You get my vote. Had just downloaded a trial version XMLSPY (which is very good) but, as you have identified, the challenge is XPath querying. Whether querying XML files or writing an XSL script, the XPath query is the tough part. Great idea!

Bill Seddon
GeneralRe: Good job Pin
Marc Brooks29-Jan-04 8:45
Marc Brooks29-Jan-04 8:45 
GeneralRe: Good job Pin
Bill Seddon29-Jan-04 8:55
Bill Seddon29-Jan-04 8:55 
AnswerRe: Good job Pin
Marc Brooks10-Oct-06 5:59
Marc Brooks10-Oct-06 5:59 
GeneralGood work, but... Pin
Christoph Lederer9-Dec-03 21:19
Christoph Lederer9-Dec-03 21:19 
GeneralRe: Good work, but... Pin
Edneeis3-Feb-04 18:59
Edneeis3-Feb-04 18:59 
GeneralGraphical XPath Queries Pin
chetmurphy9-Dec-03 18:37
chetmurphy9-Dec-03 18:37 
GeneralRe: Graphical XPath Queries Pin
Marc Brooks29-Jan-04 8:48
Marc Brooks29-Jan-04 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.