image symbolizing XQuery

XQuery Tools

Powerful Tools to Edit, Debug, and Generate XQuery

What is XQuery?

Short for XML Query, XQuery is a flexible, expressive query language designed for querying and transforming XML data. The newest version of the XQuery language also supports querying JSON data, adding maps and arrays to the data model. Working with XQuery involves constructing queries to retrieve specific information from instance documents. The heart of XQuery is the FLWOR expression (pronounced “flower”). To those not familiar with XQuery, a FLWOR expression is very similar to a SQL Select statement, making it accessible for developers familiar with database queries.

A key feature of XQuery is its ability to navigate through complex XML structures for precise extraction of data and manipulation of hierarchical information. XQuery can be used for various purposes, such as extracting information, generating summary reports, transforming XML data to XHTML, or searching web documents.

XQuery is maintained by the XML Query working group of the W3C and is an extension of the XPath language. It is compatible with several other W3C standards including XML namespaces, XSLT, XSD, and more.

Learn XQuery

Check out our free, online XQuery training course to get started learning XQuery. Experienced developers can refer to our XQuery Expressions Reference page for details about the functions and operators used to write XQuery expressions.

Edit XQuery

XMLSpy provides powerful tools for editing and debugging XQuery, as well as innovative support for XQuery back-mapping and working with XQuery Update Facility.

XQuery Editor

The XMLSpy 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.

XQuery Editor in XMLSpy

In addition to XQuery entry helpers (IntelliSense) in Text View, XMLSpy includes the XPath/XQuery window below the editing pane for point-and-click expression building and evaluator mode for real-time testing. You can evaluate the expression against one or more files: the active document, all open files, a folder, or an entire XMLSpy project.

XQuery Debugger

XMLSpy also includes a powerful XQuery debugger for testing, troubleshooting, and perfecting your XQuery expressions.

The debugger lets you go step-by-step through the evaluation, and each click shows you the results for the corresponding step. You can step into, step out, and step over XQuery evaluation steps using buttons in the debugger toolbar.

XQuery debugger

An advanced XQuery Profiler is also provided, helping you analyze and optimize your XQuery code performance.

XQuery Back-mapping

Targeted debugging is also provided via XQuery back-mapping. With back-mapping enabled, XQuery executions are carried out so that the result document can be mapped back on to the originating XQuery + XML documents. When you click on a node in the result document, the XQuery expression and the XML source data that generated that particular result node will be highlighted.

XQuery Update Facility

The XPath/XQuery window in the XML Editor also supports editing XQuery Update (XQU) Facility 1.0 and 3.0 statements with 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. This functionality is unique to XMLSpy.

Learn to Use the XQuery Update Facility Editor

Generate XQuery for Data Mapping

One use for XQuery is transforming one XML document to conform to another XML model. For generating and automating these types of transformations, MapForce is the best tool. A graphical data mapping tool, MapForce lets you define XML to XML mappings visually and apply powerful filtering and data processing functionality.

Using XQuery to transform XML in MapForce

Drag and drop to integrate data in MapForce using the following functionality:

  • XML to XML mapping
  • Auto-generation of XQuery or XSLT for XML-to-XML transformations
  • XPath Function Libraries and advanced data processing functions
  • Visual function builder
  • High-performance automation via MapForce Server
  • Additional support for other formats (JSON, PDF, databases, EDI…)

Where XQuery processing is concerned, speed is the name of the game.

Processing XQuery

Automated XQuery processing requires speed and efficiency. RaptorXML Server is built from the ground up for hyper-fast XQuery processing, accomplished through parallel computing, ultra-high performance code optimizations, and a low memory footprint.

RaptorXML Server features:

  • Parallel loading, validation, and processing by design
  • High-performance XQuery processing and XSLT processing
  • XML, JSON, and XBRL validation
  • Extensive developer related features including error reporting, .NET and Python APIs, and more
  • Integration with XMLSpy for server processing speeds inside the IDE

Use RaptorXML Server to automate processing of XQuery developed in XMLSpy and other tools.