A PROTOTYPE FOR TRANSLATING XSLT INTO XQUERY Ralf Bettentrupp University of Paderborn, Faculty 5, Fürstenallee 11, D-33102 Paderborn, Germany betra@uni-paderborn.de Sven Groppe, Jinghua Groppe Digital Enterprise Research Institute (DERI), University of Innsbruck, Institute of Computer Science, AT-6020 Innsbruck Sven.Groppe@deri.org , Jinghua.Groppe@deri.org Stefan Böttcher University of Paderborn, Faculty 5, Fürstenallee 11, D-33102 Paderborn, Germany stb@uni-paderborn.de Le Gruenwald University of Oklahoma, School of Computer Science, Norman, Oklahoma 73019, U.S.A ggruenwald@ou.edu Keywords: XML, XSLT, XQuery, Source-to-Source Translation. Abstract: XSLT and XQuery are the languages developed by the W3C for transforming and querying XML data. XSLT and XQuery have the same expressive power and can be indeed translated into each other. In this paper, we show how to translate XSLT stylesheets into equivalent XQuery expressions. We especially investigate how to simulate the match test of XSLT templates by two different approaches which use reverse patterns or match node sets. We then present a performance analysis that compares the execution times of the translation, XSLT stylesheets and their equivalent XQuery expressions using various current XSLT processors and XQuery evaluators. 1 INTRODUCTION XSLT (W3C, 1999b) and XQuery (W3C, 2005) are both languages developed for transforming and querying XML documents. XSLT and XQuery have the same expressive power. In this paper, we show how to translate XSLT stylesheets into equivalent XQuery expressions. Many commercial as well as freely available products support the evaluation of XQuery expressions, but do not support the XSLT language. Examples include Tamino XML Server (Software AG, 2004), Microsoft SQL Server 2005 Express (Microsoft, 2004) and Qizx (Franc, 2004). A translation module from XSLT stylesheets into XQuery expressions can make the XSLT language available for these products. Another usage scenario is the migration of sub- systems of legacy systems from their current language, XSLT, to the new language, XQuery. Then a translation module can be used to translate the old XSLT stylesheets so that the translated XQuery expressions can be applied instead. Note that XSLT has been used in many companies for a longer time than XQuery; therefore many applications already use XSLT. Furthermore, many XSLT stylesheets for different purposes can be found on the web, but the new XQuery technology becomes more and more important in the context of XML databases and XML enabled databases. Whenever an application requires concepts primarily supported by an XML database system or an XML enabled database system (such as the ACID properties, improved query processing or improved security), most of these database systems will require the application to use the XQuery language as the query language. Again, our contribution enables the user to alternatively formulate queries in the XSLT language and, afterwards, apply our proposed XSLT to XQuery translator to obtain equivalent XQuery expressions.