Xml Query Tool

-->

  • The XPath expression in the tool window supports intellisense based on the content XML Editor, and has tools demonstrating the use of the expression in a number of programming environments. Web Service Test Client. This tool allows you to browse a web service, select a web method, call the method and view the results.
  • XML is the most powerful data storage and transfer medium on the web. It works as XML Viewer, XML Formatter, XML Editor,XML Validator. What can you do with XML Viewer/ XML Formatter? It helps to beautify/format your XML. It helps to display your XML in a tree view. This also works as XML Pretty Print. It helps to minify your XML.

Applies to: SQL Server (all supported versions)

Is a string, an XQuery expression, that queries for XML nodes, such as elements and attributes, in an XML instance. This section provides examples of using the query method of the xml data type. Using the query method against an xml type variable. The following example declares a variable @myDoc of xml type and assigns an XML.

Query

Specifies an XQuery against an instance of the xml data type. The result is of xml type. The method returns an instance of untyped XML.

Syntax

Note

Xml query tool online

To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.

Query Xml File Tool

Arguments

XQuery
Is a string, an XQuery expression, that queries for XML nodes, such as elements and attributes, in an XML instance.

Examples

This section provides examples of using the query() method of the xml data type.

Query

A. Using the query() method against an xml type variable

The following example declares a variable @myDoc of xml type and assigns an XML instance to it. The query() method is then used to specify an XQuery against the document.

The query retrieves the <Features> child element of the <ProductDescription> element:

Xml Query Tool

The following output shows the result:

B. Using the query() method against an XML type column

In the following example, the query() method is used to specify an XQuery against the CatalogDescription column of xml type in the AdventureWorks database:

Note the following items from the previous query:

  • The CatalogDescription column is a typed xml column, which means it has a schema collection associated with it. In the XQuery Prolog, the namespace keyword defines the prefix that's later used in the query body.

  • The query() method constructs XML, a <Product> element that has a ProductModelID attribute, in which the ProductModelID attribute value is retrieved from the database. For more information about XML construction, see XML Construction (XQuery).

  • The exist() method (XML data type) in the WHERE clause finds only rows that contain the <Warranty> element in the XML. Again, the namespace keyword defines two namespace prefixes.

The following output shows the partial result:

Note the query() and exist() methods both declare the PD prefix. In these cases, you can use WITH XMLNAMESPACES to first define the prefixes and use it in the query.

See Also

Add Namespaces to Queries with WITH XMLNAMESPACES
Compare Typed XML to Untyped XML
Create Instances of XML Data
xml Data Type Methods
XML Data Modification Language (XML DML)

The XPath Expression Builder tool allows you to construct and view the results of your query as you type.

It attaches itself to the active XML Editor, so any XML panel in the environment can be queried.

The XPath Query Editor comes with Intellisense, which is intelligently taken from the content of the current XML document. The results of the XPath expression can then be seen in the active XML Editor.

Features

  • XPath Intellisense (based on XML content)
  • View results within the editor
  • Attach to any XML document
  • Build XPath expression directly from the element
  • Changes to XPath or XML reflected in real time
  • Support for namespaces
  • Code Preview for C#, VB.Net, Java, VB & XSLT
  • View overlapping result sets
  • Microsoft Visual Studio Extensions

Usage

The XPath expression can be evaluated against any XML Editor. Nodes matched by the expression are highlighted, and a tree of nodes is shown in the expression window. It is also possible to create an XPath expression from any node within an XML Document.

Namespaces used within the current XML Editor are automatically aliased for use in the XPath expression, but these can be changed added to or removed.

A code preview window shows how to execute the XPath expression in a variety of languages.

Visual Studio Extension

The XPath viewer also integrates into Microsoft Visual Studio, allowing you to run XPath queries in your standard application development environment.

XSD Tutorials

Video Tutorials

Liquid Studio Overview

Tool

This video overview shows the functionality of Liquid Studio including XML Schema Editing, XML Editing and XPath tools.

XPath Expression Builder

This video tutorial shows how to create complex XPath expressions for highlighting specific sections within XML documents.

Query

XML Editor

This video tutorial shows the functionality of the XML Editor.

Xml Query Tool Download

Try all the features of Liquid Studio Download Free Trial Now