Innovative New XPath/XQuery Tools
Support for XPath and XQuery in XMLSpy got a major boost with Release 3 of Version 2015. In addition to adding support for the latest standards versions – XPath 3.1 and XQuery 3.1 – we’ve added innovative new tools for developing and testing XPath and XQuery expressions in the XPath/XQuery window.
These new tools make it much faster to develop, evaluate, and refine expressions and statements before adding them to larger XSLT or XQuery documents. This will save you time and frustration – because you can understand how each operator or function works and ensure that your expressions return the desired results immediately. I found the function descriptions and entry helpers especially helpful for learning how the new maps and arrays features in XPath/XQuery 3.1 are implemented.
As you can see below, the XPath/XQuery Window supports all versions of XPath (1.0/2.0/3.1) and XQuery (1.0/3.1), as well as XQuery Update Facility (1.0/3.0).
The XPath/XQuery Window has two modes: Builder and Evaluator, which you can toggle between as you work.
Builder Mode
Builder mode gives you access to numerous tools that make developing XPath and XQuery expressions quick and easy:
– Point-and-click expression building, via a comprehensive a list of operators, expressions, and built in functions, which you can insert in an expression by double clicking. Functions are inserted with their arguments indicated by “#” placeholders, making it easy to build expressions quickly and error-free.
– Mouse-over hints that describe each operator, expression, and function, so you can be sure to choose the correct one for the expression at hand.
– Enhanced entry helpers that display the description of built in functions, and then show helpful function and parameter details as you type, speeding development and ensuring accuracy.
– Ready-to-use code snippets for complex statements such as FLWOR and XQuery Update Facility expressions, found in the Operator/Expression pane. Here you can read a description of each and insert the expression at the cursor by double clicking.
Evaluator Mode
Evaluator Mode lets you test the results of your XPath/XQuery statements as you work, and this has several advantages:
– Save time and avoid errors by testing expressions before adding them to your document and adjusting as needed.
– Evaluate an XPath or XQuery expression against one or more files: the active document, all open files, a folder, or an entire XMLSpy project.
– Utilize nine tabs for developing and testing complex expressions. Once you have composed an expression on one tab, switching to a new tab lets you build and analyze the results of a new expression – but when you switch back to the previous tab, the expression and results are still there. This allows you develop multiple expressions side-by-side and incrementally make changes to each one of them, preserving both the expression and the result for each tab.
Give these new XPath and XQuery tools a try now by downloading a free, 30-day trial of XMLSpy.
One last note: I mentioned that the XPath/XQuery Window not only saves time and errors, but helps when you’re trying to learn about the new features in the latest standards versions. You can also take some help from Altova’s new, free online XPath 3.0 Training course .