A better XML parser through functional programming

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

10 Citations (Scopus)


This paper demonstrates how a higher-level, declarative view of XML parsing as folding over XML documents has helped to design and implement a better XML parser. By better we mean a full-featured, algorithmically optimal, pure-functional parser, which can act as a stream processor. By better we mean an efficient SAX parser that is easy to use, a parser that does not burden an application with the maintenance of a global state across several callbacks, a parser that eliminates classes of possible application errors. This paper describes such better XML parser, SSAX. We demonstrate that SSAX is a better parser by comparing it with several XML parsers written in various (functional) languages, as well as with the reference XML parser Expat. In the experience of the author the declarative approach has greatly helped in the development of SSAX. We argue that the more expressive, reliable and easier to use application interface is the outcome of implementing the parsing engine as an enhanced tree fold combinator, which fully captures the control pattern of the depthfirst tree traversal.

Original languageEnglish
Title of host publicationPractical Aspects of Declarative Languages - 4th International Symposium, PADL 2002, Proceedings
EditorsShriram Krishnamurthi, C.R. Ramakrishnan
PublisherSpringer Verlag
Number of pages16
ISBN (Print)354043092X, 9783540430926
Publication statusPublished - 2002
Event4th International Symposium on Practical Applications of Declarative Languages, PADL 2002 - Portland, United States
Duration: 2002 Jan 192002 Jan 20

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference4th International Symposium on Practical Applications of Declarative Languages, PADL 2002
Country/TerritoryUnited States


  • Haskell
  • Scheme
  • Traversal
  • Tree fold
  • XML parsing


Dive into the research topics of 'A better XML parser through functional programming'. Together they form a unique fingerprint.

Cite this