free hit counter Visual XPath (Free XPath Query Tool) - Nauman Leghari's Blog
Wednesday, September 17, 2003 11:58 AM laghari78

Visual XPath (Free XPath Query Tool)

Download Source Code From This Page

What is Visual XPath?
Visual XPath is a graphical way of generating XPath query results. It can also be used to generate XPath queries dynamically by select XML nodes shown in the form of Tree. You can also generate queries for individual attributes.

What not is Visual XPath?
Visual XPath is not an XPath Parser. It utilizes Microsoft .NET XPath parser and other XML related APIs. It does not validate XML document against DTD or Schema. Although it will display error, if the XML document is not Well Formed. It is not an XML Editor therefore I removed Editing XML and Save As XML functions from the latest version. Although the XML file, if present on your hard disk, can be opened in the Notepad from the Utility.

How to integrate with VS.NET?
Step 1: Add to the External Tools

Goto Tools->External Tools
Add Visual XPath: Put $(ItemPath) in the Arguments text box

Step 2: Map a shortcut key to this external tool

Goto Tools->Customize
Press the Keyboard button and then write "Tools.ExternalCommand(n)" in the Show command containing text box, where n is the sequence of the Visual XPath tool. You can get this number by selecting the Tools window and counting the external tools upto Visual XPath.
The assign some shortcut key for this tools. I preferred Ctrl+Shirt+X, which is also available to use.

Known Bugs: There is a bug with the tool when dealing with nested “default namespaces“ notified by Omar. Currently, the tool searches for only root level default namespaces like in the following example.

<?xml version="1.0"?>
<Guitars xmlns="" xmlns:xsi="" xsi:schemaLocation="">

It works fine with the above file but it fails to recognize any default namespaces used inside the documents as shown in the following example.


      <body xmlns="">
      This is a sweet phone. One of these days I’ll talk a bit more about it, but

In this rss file, the <body> tag also contains the default namespace which is treated as a document level namespace by the tool, hence putting the "def" (the word to represent default level namespace) word before any tag.

This bug only effects those files which contains the nested default namespaces.
I'll try to solve this bug as soon as possible.

Note: Email me if you have any type of comments, feature-requests and suggestions, either constructive or destructive (in case they are in the destructive category, please provide your opinion). I also need to know if there are any bugs, errors in the software. The source code is not included with the download. The only reason is that it is not very well documented therefore you can email me if you want it anyway.

Contact Me

If you like this then you might like my other Projects


# re: Visual XPath

Sunday, December 14, 2003 4:52 AM by Jan Tielens

Thx! Really usefull!

# re: Visual XPath

Wednesday, January 28, 2004 11:27 AM by Nauman Leghari

I turned off all the dialog boxes showing "TODO.." statements. The updated version can be downloaded from the same url.

NOTE: Please leave your contact information with your comments so that I can contact you directly about the problem and the solution. Thanks.

# re: Visual XPath

Friday, January 30, 2004 5:35 PM by daku

Thank you. This has really saved me some time!

# re: Visual XPath

Friday, February 13, 2004 10:26 AM by Ashutosh




# re: Visual XPath SourceCode

Sunday, March 28, 2004 4:34 AM by Jens Peter Kempkes


Can't find the SourceCode in
Has it been removed?

This zip only contains a debug-folder.

Please Help,