XQuery Editor

XQuery 1.0 and XQuery 3.1 development

  • Support for schema-aware XQuery 1.0 and 3.1
  • XQuery Update Facility support
  • Integration with RaptorXML Servers for faster execution
  • Bracket matching & intelligent entry helpers
  • XQuery Debugger
  • 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

XQuery Editor

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.

Editing XQuery with XMLSpy

XQuery Entry Helpers

XQuery tools in XMLSpy include 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.

XQuery Execution Options

XQuery execution in XMLSpy is powered by the built-in RaptorXML engine, which was written from the ground up to provide the closest possible standards conformance coupled with fast speeds. Still, transformation rates achieved are limited to single-core execution on the CPU available in the developer's machine.

RaptorXML Server, on the other hand, benefits from the substantial increase in processing power afforded by multi-CPU, multi-core servers, which allow it to deliver hyper-performance through increased throughput and efficient memory utilization. You can harness these advantages by utilizing a RaptorXML Server installed on your network for executing XQuery, XSLT, and XML validation jobs. In fact, large XQuery jobs run up to 9x faster when run on RaptorXML Server from inside XMLSpy*.

* To measure this performance increase, we compared execution speeds in XMLSpy alone on a typical developer's machine: Win7 32bit, Core2 Duo E8600 3.3GHz (2 cores), 4GB RAM, against validation speeds using a common RaptorXML Server configuration: Linux server 64bit, Xeon E5-2630 2.3GHz (12 cores), 128GB RAM, from inside XMLSpy over a 1 GB network. Performance results based on Altova internal tests. Your results may vary.

XQuery Builder

XMLSpy Point-and-click XQuery Expression Builder

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.

XQuery Evaluator

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.

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.