A method for publishing relational data as XML by translating XML queries into
queries against a relational database. Conversion of the relational database into
an XML database is not required. Each relational table is mapped to a virtual XML
document, and XML queries are issued over these virtual documents. An XML query
is parsed and transformed into a language-neutral intermediate representation,
which is a sequence of operations describing how the output document is derived
from the underlying relational tables. The intermediate representation is then
translated into an SQL query over the underlying relational tables. The intermediate
representation is also used to generate a tagger graph, which the tagger runtime
'walks' to generate the tagged, structured XML output. Each of the nodes of the
tagger graph are operators which perform processing on the results of the SQL query.
The SQL query is executed, and the SQL query results are then provided to the tagger.
The tagger runtime applies the operators of each node to the inputs at that node
to produce the structured XML document as a query result, guided by the structure
of the tagger graph.