Xml Query Tool

XQuery is About Querying XML XQuery is a language for finding and extracting elements and attributes from XML documents. Here is an example of what XQuery could solve: 'Select all CD records with a price less than $10 from the CD collection stored in cdcatalog.xml'. Traditional xpath engines create DOM from XML and evaluate xpath on that DOM. Creating DOM for 50MB xml files requires lot of memory. You can try XMLDog. It evaluates xpath on large xml files without creating DOM, thus requires little memory. It comes with a command line tool xmldog.bat. It is implemented in java. So you can use it on windows. Xpath generator 1. Insert your xml in to the big field. To generate an xpath. Place the cursor in the text, attribute or element you want an xpath to.

-->

Applies to: SQL Server (all supported versions)

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

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

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.

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:

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:

Xml Query Tool

Note the following items from the previous query:

Xml Query Tool
  • 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)

HomeGuideTools ListingNewsBackgroundSearchAbout Us

As of January, 2012, this site is no longer being updated, due to work and health issues

SearchTools.com: Related Topics

XML Searching Resources

For background information, see the XML and Search page. This page provides annotated links to XML Search, Query Languages, Standards and Document Structure Registries information.

XML Text Search Engines

  • Amberfish - now supports both XML full text search with Boolean and phrase matching, as well as arbitrarily structured queries with hierarchical results.
  • IXIASOFT TEXTML database -XML database with real-time index synchronization, grouping of elements and attributes in indexes. Search features include Boolean, proximity and frequency operators. Results sorting, site is not clear on their relevance algorithm.
  • Infonyte Query - Implements the XQL Specification for both structured and free-text search.
  • XML Query Engine - JavaBean component for full-text indexing and searching of XML documents. Version 1.0 shipped Spring 2001, supports XQuery and XQL. See also local XML Query Engine info page
  • Tamino - indexes based on XML tags for full-text or structured searching, supports XPath query features, from Software AG.
  • Emily Solutions Framework (MLE) includes a search engine for XML, flat files and relational databases.
  • Ultraseek version 3 and later support searching XML files as full text, and setting up multiple sets of fields for field-specific searching, version 4 adds indexing of attributes.
  • SIM (The Structured Information Manager) uses XML and full-text indexing to provide a powerful combination of database searching and text retrieval.
  • GoXML Search Engine - does XML-specific search by providing a second step for the query with a popup menu of 'context': the markup tag for the text. There does not seem to be a way to perform free-text searching as well, but it does seem to index by using a robot and spidering external sites.

XML Structured Query Engines

  • X-Hive - XML database implementing XQuery standard.
  • XDisect - indexes and retrieves arbitrary XML data structures and supports flexible queries. Supports XML standards.
  • fxgrep - parses an XML document for complex queries and finds all matches. Distributed as source code.
  • GMD-IPSI XQL Engine - Java-based persistent storage of XML documents in DOM format, XQL queries into the data store. Free for noncommercial use: see Globit Infonyte for the commercial version.
  • XSet is an XML database and high performance search engine library with a very simple tag-oriented query language, expressed in XML itself.
  • UC Berkeley's Cheshire system indexes and searches structured data including XML, SGML and MARC records, as well as full-text data files.
  • Xtenint information routing and selection agents perform real-time filtering of data streams using various predefined rules.
  • Lore - a database management system for XML using semi-structured data,with a special query language called Lorel. This is a research project in the Stanford University computer science department.
  • sgrep search tool provides grep searching for structured documents, including XML. This is a command-line program that lets you limit searches to contents of specified XML tags, such as 'subject' or 'evaluation'. As of January, 2000, it has been updated to version 1.9 and now supports searching in hierarchies.

XML Query Languages

Xml Query Tool Windows 10

See also 'How Text Search Relates to XML Query Languages'

  • W3C XML Query
    Main page for the World Wide Web Consortium XML Query Working Group.
    • XML Query Requirements (Current Working Document) New release on February 16, 2001
      This URL points to the most current version of the XML Query Working Group requirements document for how the standard XML query language should work, with general goals, usage scenarios, terminology, data model information, functionality, and how the language should fit with the other XML standards.
    • XQuery: A Query Language for XML New release on February 15, 2001
      Implementation of a query language based on the requirements.
  • XML Query Languages: Experiences and ExemplarsSummer, 1999
    Examines four existing XML query languages in order to define the requirements for such a language. Tends to be more SQL-oriented than search-engine oriented.
  • QL '98: the Quest for an XML Query StandardLisa Rein, XML.com, March 2, 1999
    Covers the discussion at the W3C Query Language workshop in December 1998. There were more participants than expected, from XML/SGML implementors through database companies, librarians and researchers. Discussion there was about database-style querying providing selection (search), extraction, reduction, restructuring and combination of XML text.. Some participants want to make a query language like SQL or OQL, others see a relationship to research in 'semi-structured' data retrieval, while others hope to use XSL to perform these tasks. There was controversy over what the results should look like, and about if they should come in XML only or in other formats.
  • QL '98 Position PapersW3C
    66 papers from the participants in the W3C Query Language workshop in December 1998.
  • W3C XML Query Language mailing list (for the general public), with open archives. To subscribe, send a message to www-ql-request@w3c.org and put the word subscribe in the body of the message (remove your signature).

XQL

  • XQL Proposal submitted to the W3C, proposes a query language for 'addressing and filtering the elements and text of XML documents' as an extension of the XSL pattern syntax.
  • XQL FAQ - links and background information for this proposal, list of the applications that have implemented it so far.
  • XQL Tutorial - simple explanation with examples

XML-QL

Xml Query Tool Software

  • XML-QL, Query Language for XML Proposal submitted to W3C. Proposes a query language approaching an XML file much like searching a database with SQL, rather than a free-text document. The focus of this proposal is EDI (Electronic Data Interchange, business-to-business purchasing) as opposed to a library or information retrieval approach. It provides examples using specific data and element patterns and constructing new results listings

XML Standards and Overviews

  • Extensible Markup Language (XML) W3C standard information

  • Robin Cover's SGML/XML Web page - a comprehensive overview with lots of pertinent information -- a great resource!

  • OASIS Web Site: Home Page Organization for the Advancement of Structured Information Standards - a vendor-neutral consortium supporting XML, SGML and HTML.

  • XML.com - includes many articles, the XML specification annotated by Tim Bray, and a way to test for well-formed files.

  • XMLInfo.com - XML news, introductory articles and reviews by the well-regarded James Tauber.

  • Frequently Asked Questions about XML - useful FAQ.

  • XML and Databases Extremely thoughtful discussion of how XML relates to databases and vice versa by Ronald Bourret.

  • XML and the Second-Generation WebScientific American, May 1999 by Jon Bosak and Tim Bray - describes features of XML and some possible future search functionality.

  • Web / XML - webreference.com - Nice site with tutorials, products links and other references.

  • John Cowan's XML Index- Includes info on RDF, XCond, IBTWSHD (a HyperText DTD), XCatalog and so on.

  • Search the XML-Dev Mailing List Archives - the mailing list is where developers work through some of the knotty issues of namespaces, fragments and other bleeding-edge technology. If you have an implementation question, it's probably been discussed with all possible implications on this list, so check the archives first!

XML Registries: Standardizing Document Structures

Groups from genealogists to real-estate brokerages want to share data without having to use complex file format converters, and they are banding together to create open XML DTDs and other structures. Today, the only standard way of structuring XML documents is with DTDs (document type descriptors). But there are several proposals for richer and more complex systems, known as schema. In any case, shared structures will improve searching as all data will be in the same format and will not require special field names.

  • XSLT: XML Transformations - A standard system for converting XML documents with one set of tags into documents with another set of tags.
  • OASIS Registry and Repository Technical Committee - a group working on standards for XML DTD and Schema registries.
  • XMLSchema.com - tools to validate XML Schema (more complex than DTDs) and convert them to another dialect such as DTD.
  • Schema Repositories: What's at Stake?XML.com, January 26, 2000 by Liora Alschuler
    Describes the existing schema registries and the issues involved in controlling schema, especially for e-commerce.

Other Listings

  • XML Query Languages, Databases and Search (Northern Light Special Edition, XML)

Query Xml File Tool

Page Updated 2002-12-18
HomeGuide Tools ListingNewsBackgroundSearchContact

Xml Query Tool Download

Avi Rappoport of Search Tools Consulting can help you evaluate your search engine, whether it's on a site, portal, intranet, or Enterprise. Please contact SearchTools for more information.

Xml Query Tool Free

This information copyright © 2010 Avi Rappoport, Search Tools Consulting. Some Rights Reserved, under the Creative Commons Attribution-Share Alike 3.0 United States License. Please attribute copied content to the page's full URL. Permissions beyond the scope of this license are available upon request.