1. Introduction to XML-QL query and its commonly used grammar structure
There are several important issues that need to be solved in the face of large XML data. For example, using what technology or tools can extract data from a large XML document; XML data can be translated between different DTDs; data can be combined from multiple XML documents; or can transmit a large number of XML data.
Data extraction, transmission, merge is a traditional database problem, which solves the implementation of Structured Query Language SQL. However, SQL cannot be applied directly to XML because the data structure in XML includes not only conventional structured data format, but also contains a large number of semi-structural data. The appearance of XML-QL solves these issues.
The XML-QL language can extract information from the XML document by querying, and can translate XML data between different DTDs, and can bind to data from multiple XML documents, which can transmit XML data.
The XML-QL query language currently proposed by the W3C is the standard language of the XML document, and there are also some XML query languages independently developed by other organizations, such as AT & T's STRU-QL. The following discussion is based on the standard QL proposed by W3C. Introducing the five grammatical structures of XML-QL as input as input. The document lib.xml is as follows:
Xml Version = "1.0?>
book>
lib>
(1) Match data with mode
XML-QL uses element mode to find data in an XML document. If you check the authors of all Tsinghua University Press, you can use the following query:
WHERE
book> in "lib.xml"
Construct $ A
In the above search, the matching
(2) Establish XML data
In the above query, XML-QL will generate a range of
book> in "lib.xml"
Construct
result>
We will get the following results after application query:
result>
result>