XML Query Language (XQL)
About XML Query Language (XQL):
Excerpts from document:
The XML Query Language (XQL) is a notation for addressing and filtering the elements and text of XML documents. XQL is a natural extension to the XSL pattern syntax. It provides a concise, understandable notation for pointing to specific elements and for searching for nodes with particular characteristics. This proposal was provided in September 1998 to the XSL Working Group ( http://www.w3.org/Style/XSL/Group/1998/09/XQL-proposal.html ) as input when considering extensions to the XSL pattern syntax.
The XSL pattern language ( http://www.w3.org/TR/WD-xsl section 2.6) provides an extremely understandable way to describe a class of nodes to process. It is declarative rather than procedural. One simply describes the types of nodes to look for using a simple pattern modeled after directory notation. For example, book/author means find author elements contained in book elements.
XQL (XML Query Language) provides a natural extension to the XSL pattern language. It builds upon the capabilities XSL provides for identifying classes of nodes, by adding Boolean logic, filters, indexing into collections of nodes, and more.
XQL is designed specifically for XML documents. It is a general purpose query language, providing a single syntax that can be used for queries, addressing, and patterns. XQL is concise, simple, and powerful.
Note that the term XQL is a working term for the language described in this proposal. It is not our intent that this term be used permanently.
For an excellent paper describing the justification for XQL and its theoretical background, please see Jonathan Robie's paper The Design of XQL.
Here are the design goals for XQL:
* XQL strings shall be compact.
* XQL shall be easy to type and read.
* XQL syntax shall be simple for the simple and common cases.
* XQL shall be expressed in strings that can easily be embedded in programs, scripts, and XML or HTML attributes.
* XQL shall be easily parsed.
* XQL shall be expressed in strings that can fit naturally in URLs.
* XQL shall be able to specify any path which may occur in an XML document and specify any set of conditions for the nodes in the path.
* XQL shall be able to uniquely identify any node in an XML document.
* XQL queries may return any number of results, including 0.
* XQL queries are declarative, not procedural. They say what should be found, not how it should be found. This is important because a query optimizer must be free to use indexes or other structures in order to find results efficiently.
* XQL query conditions may be evaluated at any level of a document, and are not expected to navigate from the root of a document.
* XQL queries return results in document order with no repeats of nodes.
XQL is designed to be used in many contexts. Although it is a superset of XSL patterns, it is also applicable to providing links to nodes, for searching repositories, and for many other applications.
XQL is a notation for retrieving information from a document. The information could be a set of nodes, information about node relationships, or derived values. The specification does not indicate the output format. The result of a query could be a node, a list of nodes, an XML document, an array, or some other structure. That is, XQL does not dictate the binary format of the returns, but rather the logical returns.
In some implementations the result of a query will be an XML document or a tree that can be fed back in to XQL. In other cases the result will be a different type of structure, such as a set of pointers to nodes. Thus, closure is not guaranteed. If the implementation returns XML, then the XML must be well formed, and thus closure is guaranteed.
The XML Query Language (XQL) is a notation for addressing and filtering the elements and text of XML documents. XQL is a natural extension to the XSL pattern syntax. It provides a concise, understandable notation for pointing to specific elements and for searching for nodes with particular characteristics. This proposal was provided in September 1998 to the XSL Working Group ( http://www.w3.org/Style/XSL/Group/1998/09/XQL-proposal.html ) as input when considering extensions to the XSL pattern syntax.
The XSL pattern language ( http://www.w3.org/TR/WD-xsl section 2.6) provides an extremely understandable way to describe a class of nodes to process. It is declarative rather than procedural. One simply describes the types of nodes to look for using a simple pattern modeled after directory notation. For example, book/author means find author elements contained in book elements.
XQL (XML Query Language) provides a natural extension to the XSL pattern language. It builds upon the capabilities XSL provides for identifying classes of nodes, by adding Boolean logic, filters, indexing into collections of nodes, and more.
XQL is designed specifically for XML documents. It is a general purpose query language, providing a single syntax that can be used for queries, addressing, and patterns. XQL is concise, simple, and powerful.
Note that the term XQL is a working term for the language described in this proposal. It is not our intent that this term be used permanently.
For an excellent paper describing the justification for XQL and its theoretical background, please see Jonathan Robie's paper The Design of XQL.
Here are the design goals for XQL:
* XQL strings shall be compact.
* XQL shall be easy to type and read.
* XQL syntax shall be simple for the simple and common cases.
* XQL shall be expressed in strings that can easily be embedded in programs, scripts, and XML or HTML attributes.
* XQL shall be easily parsed.
* XQL shall be expressed in strings that can fit naturally in URLs.
* XQL shall be able to specify any path which may occur in an XML document and specify any set of conditions for the nodes in the path.
* XQL shall be able to uniquely identify any node in an XML document.
* XQL queries may return any number of results, including 0.
* XQL queries are declarative, not procedural. They say what should be found, not how it should be found. This is important because a query optimizer must be free to use indexes or other structures in order to find results efficiently.
* XQL query conditions may be evaluated at any level of a document, and are not expected to navigate from the root of a document.
* XQL queries return results in document order with no repeats of nodes.
XQL is designed to be used in many contexts. Although it is a superset of XSL patterns, it is also applicable to providing links to nodes, for searching repositories, and for many other applications.
XQL is a notation for retrieving information from a document. The information could be a set of nodes, information about node relationships, or derived values. The specification does not indicate the output format. The result of a query could be a node, a list of nodes, an XML document, an array, or some other structure. That is, XQL does not dictate the binary format of the returns, but rather the logical returns.
In some implementations the result of a query will be an XML document or a tree that can be fed back in to XQL. In other cases the result will be a different type of structure, such as a set of pointers to nodes. Thus, closure is not guaranteed. If the implementation returns XML, then the XML must be well formed, and thus closure is guaranteed.