XML has silently taken over the world, at least in the domains of online/print publishing and applications that require exchanges of small amounts of data. However, writing programs that do something with XML is still tedious, because there are too many approaches that work only for limited range of tasks. Examples are the use XSLT for recursive transformations, XQuery for database-like querying, and conventional general purpose programs like Java that manipulate XML through clumsy library functions.
Scala is a general-purpose language that offers some remedy. The language unifies functional and object-oriented programming, which allows to easily integrate queries and transformations. In order to better support XML programming, the use of standard XML syntax inside Scala source code is permitted, and a well-balanced library offers functionality that is frequently needed for XML manipulation such as XPath selection. An experimental subproject is data-binding, which maps type information given in DTDs or an XML Schema into Scala classes.
In order to evaluate the usefulness of the language, we walk through the code of a real-life application that takes advantage of Scala's design: "aladdin" (http://maglite.epfl.ch/bugtracking ) is an interactive server application used at LAMP which connects user to a relational database, generating XHTML on the fly. Apart from this application, we have tools that translate XQuery and XSLT into Scala code in order to be able to migrate from these special-purpose languages. We discuss strengths and room for improvement.
Burak Emir studied computer science in Aachen, Germany (started 1997) and came to CERN as a summer student in 2000. He graduated in 2003, and since then pursues a PhD degree at the Programming Languages and Methods Group at EPFL. His research topic are programming language abstractions for XML data.