TY - GEN
T1 - A better XML parser through functional programming
AU - Kiselyov, Oleg
PY - 2002/1/1
Y1 - 2002/1/1
N2 - 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.
AB - 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.
KW - Haskell
KW - Scheme
KW - Traversal
KW - Tree fold
KW - XML parsing
UR - http://www.scopus.com/inward/record.url?scp=84947271086&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84947271086&partnerID=8YFLogxK
U2 - 10.1007/3-540-45587-6_14
DO - 10.1007/3-540-45587-6_14
M3 - Conference contribution
AN - SCOPUS:84947271086
SN - 354043092X
SN - 9783540430926
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 209
EP - 224
BT - Practical Aspects of Declarative Languages - 4th International Symposium, PADL 2002, Proceedings
A2 - Krishnamurthi, Shriram
A2 - Ramakrishnan, C.R.
PB - Springer Verlag
T2 - 4th International Symposium on Practical Applications of Declarative Languages, PADL 2002
Y2 - 19 January 2002 through 20 January 2002
ER -