Information Technology Reference
In-Depth Information
SQL
RDB
schema
XML
schema
1. Explicit syntax
transformation
2. Create SQL
query graph(QG)
3. Map SQL QG to
XQL QG
4. Transform XQL
QG to XQL query
SQL QG
XQL QG
XQL
Fig. 5.13 Process for SQL to XQL transformation
The basic syntax SQL SELECT statement is in the form of:
6(/(&7^DWWULEXWHOLVW`)520^UHODWLRQOLVW`:+(5(^MRLQ
FRQGLWLRQ`$1'25^VHDUFKFRQGLWLRQ`25'(5%<^DWWULEXWHOLVW
`*5283%<^DWWULEXWHOLVW`
+$9,1*^VHDUFKFRQGLWLRQ`
The SQL query is decomposed into groups by parsing its syntax into the identifier
list, relation list, and search conditions from the SQL query.
2. Create the SQL QG
Based on the relation list and the join condition in the SQL query transaction, the
SQL QG is created. The join condition is based on the natural join or based on the
search condition specified in the SQL query.
3. Map the SQL QG to XPath QG
The SQL QG is mapped to the XPath QG. The table joins from the SQL QG forms
the XPath location path, which are the steps for navigating down the document tree
from root node.
4. Transform SQL to XPath query
In this step, the SQL query is transformed into XPath syntax as:
URRWQRGH>#DWWULEXWH FRQGLWLRQ@«QRGH>#DWWULEXWH FRQGLWLRQ@#
DWWULEXWH
The attribute-list in the SQL query is mapped to the leaf attribute node at the bottom
of the document tree. If all the attributes of the element node are selected, “@*” is
mapped to select all the attributes from the leaf element node.
Search WWH ::




Custom Search