AquaPath is a Mac OS X Developer Tool for that allows you to evaluate XPath 2.0 expressions against any XML document and view the result sequence in a dynamic, intuitive tree representation.
Update: Version 1.1 released! New in this version:
There are two ways to select the context node for your expression
Regarding the line numbers added to the source editor... these are not particularly robust. AquaPath is not a good XML document editor. The source editor and line numbers are provided strictly for convenience and experimentation. If you are trying to do serious document editing with AquaPath, you are cracked out your head. Please don't write me about how poor a text editor AquaPath is. I know. That's not what it's supposed to be.
Update: Version 1.0.3 released!
This is a bug fix release (1.0.3).
1 + 2now behave as expected)
Update: Version 1.0.2 released!
This is a bug fix release (1.0.2). Prior versions would not display comment or processing instruction children of the document node under the "Display" tab... only the document element (outermost element) was being displayed.
Update: Version 1.0.1 released!
This is a bug fix release (1.0.1). I realized that the "Results" tab was not really showing correct the string-value result for a given XPath expression. Instead, it was showing the full serialized XML string representation of the nodes that were matched by the XPath expression. The distinction is subtle, but important.
For example, if your XPath expression happened to return a node-set sequence containing a single node whose serialized XML string representation was:
AquaPath 1.0 would have shown this string in the "Results" tab:
Although this information might be useful, if you are familiar with the (highly-readable) XPath 1.0 spec, then you know this is not the same as the "string-value" of an XPath result sequence (or node-set). The string-value is actually more important and would correctly be reported as:
Here's an example of the difference between AquaPath 1.0 and 1.0.1 results for an attribute node such as this:
Again, this matches the common XPath concept of a string-value which is mostly likely what you are looking for when using XPath. Sorry for the confusion in 1.0!
Using AquaPath is simple! Open an existing XML document (of any type) or even author an XML document using AquaPath itself (AquaPath is also a rudimentary text editor). The source text of your XML document appears under the "Source" tab in an AquaPath document window... use this tab to author or edit your document.
Next, type an XPath expression into the "XPath" textfield at the top of the AquaPath document window. Click "Evaluate" to see the matching node sequence. You will see a status bar message just below the XPath text field showing either the number of nodes in the result sequence or and error message if your XML document is not well-formed or if your XPath expression is invalid.
Under the "Results" tab, you will find a text area containing the string value of the result sequence. The whitespace of each node has been compressed so that you will see a single node's string value per line. This tab's contents are convenient for copy-pasting the results to another text editor or wherever.
The "Display" tab is where all the magic happens. Here you will see a dynamic (DHTML), syntax-colored representation of your XML document with "-" or "+" signs next to each element node. Use these symbols for collapsing and expanding a given element and its children. Also, all nodes and text matching your XPath expression will be highlighted in yellow. Cool!
AquaPath requires Mac OS X 10.4 Tiger or later.
AquaPath is implemented using Apple's Awesome Cocoa/Objective-C NSXML Framework. NSXML supports a large subset of XPath 2.0. AquaPath is not a 'Schema-Aware' XPath implementation... meaning that it does not support selecting nodes via additional type annotations added by validating your document against an XSD (W3C XML Schema).