shows that many XQuery constructs are easily
mappable to XSLT by examples, but does not
provide an algorithm for translating XQuery
expressions into XSLT stylesheets.
(Klein et al., 2005) and (Lechner et al., 2001)
present an algorithmic approach of translating
XQuery expressions into XSLT stylesheets, which is
the opposite direction to our translation.
Saxon (Kay, 2005) is a processor for both, for
XQuery expressions and for XSLT stylesheets,
which uses a mostly common object model.
(Moerkotte, 2002) describes how XSL
processing can efficiently be incorporated into
database management systems. We extend the
reverse pattern approach of (Moerkotte, 2002) by all
axes of XPath. In comparison to (Moerkotte, 2002),
we present a translation method from XSLT
stylesheets into XQuery expressions and introduce
the match node sets approach.
(Fokue, 2005) describes a translation from XSLT
stylesheets into XQuery expressions. In comparison
to (Fokue, 2005), we additionally introduce the
match node set approach. (Groppe, 2005) includes a
chapter dealing with the translation from XSLT
stylesheets to XQuery expressions.
5 CONCLUSIONS
In this paper, we have proposed a translation process
converting XSLT stylesheets to XQuery
expressions. The main difficulty is to simulate the
template selection of XSLT. In order to identify the
template to be executed, we have presented two
different methods for the simulation of the template
selection process. The match node sets approach
checks whether the current XML node is contained
in a pre-computed set of XML nodes and the reverse
pattern approach executes the reversion of the
match patterns of templates. We have developed a
runtime library, which contains functions in order to
simulate XSLT instructions. The remaining XSLT
instructions are inlined by XQuery sub-expressions.
We have carried out several experiments. In rare
cases, the translated XQuery expressions using the
reverse pattern approach with the XQuery evaluator
Qizx are a little bit faster than the execution of the
original XSLT stylesheet. Except of rare cases, the
reverse pattern approach is faster than the match
node sets approach for the XQuery expressions.
Therefore, we have achieved the goal to make
XSLT practically usable for the broad fields of
XQuery tools, XML databases and XML enabled
databases, which support XQuery.
ACKNOWLEDGEMENTS
This material is based upon works supported by the
EU funding under the Adaptive Services Grid
project (FP6 – 004617). Furthermore, this material is
based upon works supported by the Science
Foundation Ireland under Grant No.
SFI/02/CE1/I131. This material is based upon work
supported by (while serving at) the National Science
Foundation (NSF). Any opinion, findings, and
conclusions or recommendations expressed in this
material are those of the authors and do not
necessarily reflect the views of the NSF.
REFERENCES
Apache Software Foundation, 2003. Xalan-Java,
http://xml.apache.org/xalan-j/index.html.
Developer, 2005. XSLT Mark version 2.1.0,
http://www.datapower.com/xmldev/xsltmark.html.
Franc, X., 2004. Qizx/open version 0.4p1,
http://www.xfra.net/qizxopen/.
Fokoue, A., Rose, K., Siméon, J., and Villard, L., 2005.
Compiling XSLT 2.0 into XQuery 1.0, WWW 2005,
Chiba, Japan.
Groppe, S., 2005. XML Query Reformulation for XPath,
XSLT and XQuery, Sierke-Verlag, ISBN 3-933893-
24-0, Göttingen.
Kay, M. H., 2004. Saxon - The XSLT and XQuery
Processor, http://saxon.sourceforge.net.
Klein, N., Groppe, S., Böttcher, S., and Gruenwald, L.,
2005. A Prototype for Translating XQuery
Expressions into XSLT Stylesheets, In ADBIS, Talinn,
Estonia.
Lechner, S., Preuner, G., and Schrefl, M., 2001.
Translating XQuery into XSLT, In ER 2001
Workshops, Yokohama, Japan.
Lenz, E., 2004. XQuery: Reinventing the wheel?
http://www.xmlportfolio.com/xquery.html.
Microsoft, 2004. SQL Server 2005 Express,
http://www.microsoft.com/sql/express.
Moerkotte, G., 2002. Incorporating XSL Processing Into
Database Engines. In VLDB, Hong Kong, China.
Software AG, 2004. Tamino XML Server,
http://www.softwareag.com/tamino/News/tamino_41.
htm.
W3C, 1999a. XML Path Language (XPath) Version 1.0,
W3C Recommendation,
http://www.w3.org/TR/xpath/.
W3C, 2005. XQuery 1.0: An XML Query Language, W3C
Working Draft.
W3C, 1999b. XSL Transformations (XSLT) Version 1.0,
W3C Recommendation,
http://www.w3.org/TR/1999/REC-xslt-19991116.
A PROTOTYPE FOR TRANSLATING XSLT INTO XQUERY
29