SXSLT: Manipulation Language for XML

  • Oleg Kiselyov
  • Shriram Krishnamurthi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2562)


The growing use of XML languages has spurred the demand for means to transform XML documents. Many XML transformation systems are, however, limited in their expressive power, and fail to provide a useful collection of combinators for several tasks. This paper describes SXSLT, a practical, higher-order, concise, expressive and readable declarative XML transformation language. The language is a head-first rewriting system over abstract XML syntax trees, implemented as a library extension of Scheme. SXSLT features local scoping of re-writing “templates”, first-class stylesheets, flexible traversal strategies, the ability to re-traverse the original or the transformed trees. The language can emulate XSLT in whole or in part, in a more coherent and expressive manner. By virtue of being a Scheme library, SXSLT is seamlessly integrated with Scheme.

We illustrate the power of SXSLT with several examples abstracted from practical projects. We and other people have used SXSLT for over two years for real-life projects, ranging from authoring of static and dynamic Web pages to content-distribution engines. Our experience and user comments show that SXSLT is expressive and easy to use. We argue that this outcome is a consequence of SXSLT providing right abstractions for XML transformations, of being higher-order, declarative and extensible.


XML SXML XSLT tree traversal Scheme 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abresch, B.: for those keeping score... A message on the PLT-Scheme mailing list. May 30, 2002
  2. 2.
    Bosworth, A.: Programming Paradox. XML Magazine, February 2002 02/magazine/departments/endtag/
  3. 3.
    Durand, D.: private communication. May 22, 2002Google Scholar
  4. 4.
    ISO/IEC. Information technology, Processing Languages, Document Style Semantics and Specification Languages (dsssl). Technical Report 10179:1996(E), ISO (1996)Google Scholar
  5. 5.
    Fuchs, M.: SOXT: Building the XSL Family of Languages. The Eleventh International World Wide Web Conference. Proc. Alternate Paper Tracks (2002)
  6. 6.
    Hosoya, H., Pierce, B.C.: Regular expression pattern matching for XML. In The 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2001) 67–80Google Scholar
  7. 7.
    Kiselyov, O.: Aviation total weather and SIGMET advisory queries. June 12, 2000
  8. 8.
    Kiselyov, O.: SXML as a normalized database. April 17, 2001
  9. 9.
    Kiselyov, O.: A better XML parser through functional programming. In: Lecture Notes in Computer Science, Vol. 2257. Springer-Verlag, Berlin Heidelberg New York (2002) 209–224Google Scholar
  10. 10.
    Kiselyov, O.: SXML Specification. Revision 2.5. August 9, 2002
  11. 11.
    Kiselyov, O., Krishnamurthi, S.: SXSLT: Manipulation Language for XML. Master SXML file.
  12. 12.
    Krishnamurthi, S., Felleisen, M., Duba, B.F.: From Macros to Reusable Generative Programming. In: Lecture Notes in Computer Science, Vol. 1799. Springer-Verlag, Berlin Heidelberg New York (1999) 105–120Google Scholar
  13. 13.
    Krishnamurthi, S., Gray, K.E., Graunke, P.T.: Transformation-by-Example for XML. Practical Aspects of Declarative Languages (2000)Google Scholar
  14. 14.
    Lieberherr, K.L., Patt-Shamir, B.: Traversals of Object Structures: Specification and Efficient Implementation. Technical Report NU-CCS-97-15, College of Computer Science, Northeastern University, Boston, MA (1997)Google Scholar
  15. 15.
    Moertel, T.: XSLT, Perl, Haskell, & a word on language design. Posted on on January 15, 2002
  16. 17.
    Wallace, M., Runciman, C.: Haskell and XML: generic combinators or type-based translation? Proc. the fourth ACM SIGPLAN international conference on Functional programming (1999) 148–159Google Scholar
  17. 18.
    Wallace, M., Runciman, C.: HaXml-1.07b (2002)

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Oleg Kiselyov
    • 1
  • Shriram Krishnamurthi
    • 2
  2. 2.Brown UniversityUSA

Personalised recommendations