XMLSpy XQuery Editing Features:
- Support for schema-aware XQuery 1.0 and 3.1
- XQuery Update Facility support
- Powered by RaptorXML for lightning fast processing
- Syntax coloring, line numbering, bookmarking, & source folding
- Bracket matching & intelligent entry helpers
- XQuery validation
- Intelligent XPath auto-completion
- Instant XQuery evaluation
- XQuery execution against XML or XML-enabled relational databases
- Support for IBM's DB2 XQuery extensions
XMLSpy provides native support for XQuery 1.0 and XQuery 3.1 development and execution with its built-in, standards-conformant XQuery engine powered by RaptorXML. RaptorXML delivers hyper-fast XQuery processing to speed development and test functionality prior to deployment to RaptorXML Server.
The XQuery editor has built-in knowledge of XQuery syntax and provides you with context-sensitive entry helpers at all times, including a list of variables that is updated dynamically as you edit the document. Using the XQuery editor in advanced text view provides intelligent editing features such as syntax coloring, automatic code completion, and many other time-saving utilities to help you create and edit XQuery documents quickly and easily.
Support for schema-awareness in the XQuery editor allows you to harness the full power of XQuery through mechanisms for error isolation, simplified debugging, and enhanced code performance.
XQuery Entry Helpers
The XQuery editor provides context-sensitive entry helpers in drop-down menus that open as you type. Entry helpers are also listed in three entry helper windows, as shown in the screenshot above. The color of items in the three Entry Helpers are different and correspond to the syntax coloring used in the text for easy reference.
The XQuery Keywords and XQuery Functions entry helpers are those supported by the XMLSpy XQuery engine. The variables are defined in the XQuery document itself. When a $ and a character are entered in the XQuery document, the character is listed in the Variables entry helper. As soon as a variable name that is being entered matches a variable name that already exists, the newly entered variable name disappears from the Entry Helper.
These entry helpers make it easier to edit XQuery documents by providing valid choices and options as you type, and are also available in the XQuery builder/evaluator window, as described below.
The built-in RaptorXML XQuery engine supports XQuery validation and execution against XML instance(s) or XML databases.
Support for executing XQuery against XML-enabled relational databases is currently provided for IBM DB2 9 only, and XMLSpy supports IBM's DB2 XQuery extensions:db2fn:xmlcolumn and db2:fn:sqlquery.
The XPath/XQuery window provides numerous helpful tools for building and testing XQuery expressions, including a builder mode with helpful tools for developing XQuery expressions and evaluator mode for real-time results testing. The XPath/XQuery Builder mode provides:
- Point-and-click expression building, via a comprehensive a list of operators, expressions, and built in functions, which you can insert in your current expression by double clicking. Functions are inserted with their arguments indicated by “#” placeholders, making it easy to build expressions quickly and error-free. You can view a description of each item by hovering your mouse over it in the list.
- Enhanced entry helpers that display the description of built in functions, and then show helpful function and listentrymeter 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, which are found in the Operator/Expression pane. Here you can read a description of each and insert the expression at the cursor by double clicking.
- Nine tabs for developing and testing complex expressions. Once you have composed an XPath or XQuery statement 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 to switch back and forth between multiple expressions that you develop side-by-side and incrementally make changes to each one of them, preserving both the expression AND the result for each tab.
You can see the XQuery Window in Builder mode in the screenshot below.
Built into the XPath/XQuery window is the Evaluator tab, which let you test the results of your XPath/XQuery expressions as you work. Once you’re finished building an expression, click over to Evaluator mode to test the results. You can evaluate the expression against one or more files: the active document, all open files, a folder, or an entire XMLSpy project.
The XQuery Evaluator speeds XQuery development considerably, because you can immediately see the results generated by each expression and adjust as needed. The nine separate tabs come in handy here, as well, because you can see the results of each new expression as you work.
The screenshot below shows the XQuery Evaluator.
XQuery Update Facility
Editing XQuery Update Expressions
XMLSpy supports XQuery Update Facility 1.0 and 3.0, making it easy to implement the five types of update expressions: insert, delete, replace, rename, and transform. The XPath/XQuery tab provides advanced functionality for composing XQuery Update Facility expressions with full syntax coloring, intelligent code completion, and error message reporting.
The results pane lets you preview the results of the changes, and clicking on a result in the preview pane highlights the affected node in your instance document. Then, you can execute the updates with one click, either in the current file or across all open files, a folder, or an entire XMLSpy project.
Check out this short video showing XQuery Update Facility in XMLSpy.