Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abresch, B.: for those keeping score... A message on the PLT-Scheme mailing list. May 30, 2002 http://www.cs.utah.edu/plt/mailarch/plt-scheme-2002/msg00998.html
Bosworth, A.: Programming Paradox. XML Magazine, February 2002 http://www.fawcette.com/xmlmag/2002 02/magazine/departments/endtag/
Durand, D.: private communication. May 22, 2002
ISO/IEC. Information technology, Processing Languages, Document Style Semantics and Specification Languages (dsssl). Technical Report 10179:1996(E), ISO (1996)
Fuchs, M.: SOXT: Building the XSL Family of Languages. The Eleventh International World Wide Web Conference. Proc. Alternate Paper Tracks (2002) http://www2002.org/CDROM/alternate/417/index.html
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–80
Kiselyov, O.: Aviation total weather and SIGMET advisory queries. June 12, 2000 http://zowie.metnet.navy.mil/cgi-bin/oleg/get-advisories http://zowie.metnet.navy.mil/~dhuff/pqa/FNMOC.html
Kiselyov, O.: SXML as a normalized database. April 17, 2001 http://pobox.com/~oleg/ftp/Scheme/xml.html#SXML-as-database
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–224
Kiselyov, O.: SXML Specification. Revision 2.5. August 9, 2002 http://pobox.com/~oleg/ftp/Scheme/SXML.html
Kiselyov, O., Krishnamurthi, S.: SXSLT: Manipulation Language for XML. Master SXML file. http://pobox.com/~oleg/ftp/Scheme/SXSLT.scm
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–120
Krishnamurthi, S., Gray, K.E., Graunke, P.T.: Transformation-by-Example for XML. Practical Aspects of Declarative Languages (2000)
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)
Moertel, T.: XSLT, Perl, Haskell, & a word on language design. Posted on kuro5hin.org on January 15, 2002 http://www.kuro5hin.org/story/2002/1/15/1562/95011
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–159
Wallace, M., Runciman, C.: HaXml-1.07b (2002) http://www.cs.york.ac.uk/fp/HaXml/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kiselyov, O., Krishnamurthi, S. (2003). SXSLT: Manipulation Language for XML. In: Dahl, V., Wadler, P. (eds) Practical Aspects of Declarative Languages. PADL 2003. Lecture Notes in Computer Science, vol 2562. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36388-2_18
Download citation
DOI: https://doi.org/10.1007/3-540-36388-2_18
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00389-2
Online ISBN: 978-3-540-36388-0
eBook Packages: Springer Book Archive