Copenhagen Programming Language Seminar


XSugar: Reversible Stylesheets

Claus Brabrand,
BRICS, Department of Computer Science (DAIMI), University of Aarhus

Thursday, March 17th, 15:15-16:00
ITU, Rued Langgaards Vej 7, auditorium 3


XSLT stylesheets may be used to provide an alternative and more legible syntax for XML documents. However, such transformations are not reversible since no tool exists to automatically parse the alternative syntax back into XML.

We present XSugar, which is a reversible stylesheet language for XML. An XSugar specification is built around a context-free grammar for the alternative syntax and gives a template-based translation into XML. The XSugar tool can then provide three services:

  • a static guarantee that all XML documents generated from alternative syntax are valid according to a given XML schema;
  • a translation from alternative syntax into XML; /and/
  • a reverse translation from XML into alternative syntax (provided certain injectivity requirements are satisfied).
The well-formedness of both translations are statically checked.

Thus, XSugar is useful for providing an /XML/ syntax for an existing language or for providing an alternative syntax for an existing XML language.

This is on-going joint work with Anders Møller and Michael Schwartzbach.

Scientific host: Thomas Hildebrandt. Administrative host: Camilla Jensen. All are welcome.
The Copenhagen Programming Language Seminar (COPLAS) is a collaboration between DIKU, ITU and KVL.
To receive information about COPLAS talks by email, send a message to prog-lang-request@mail.it-c.dk with the word 'subscribe' as subject or in the body.

For more information about COPLAS, see http://www.coplas.org