Typed iterators for XML
G Castagna, K Nguyen - Proceedings of the 13th ACM SIGPLAN …, 2008 - dl.acm.org
Proceedings of the 13th ACM SIGPLAN international conference on Functional …, 2008•dl.acm.org
XML transformations are very sensitive to types: XML types describe the tags and attributes
of XML elements as well as the number, kind, and order of their sub-elements. Therefore,
operations, even simple ones, that modify these features may affect the types of documents.
Operations on XML documents are performed by iterators that, to be useful, need to be typed
by a kind of polymorphism that goes beyond what currently exists. For this reason these
iterators are not programmed but, rather, hard-coded in the languages. However, this …
of XML elements as well as the number, kind, and order of their sub-elements. Therefore,
operations, even simple ones, that modify these features may affect the types of documents.
Operations on XML documents are performed by iterators that, to be useful, need to be typed
by a kind of polymorphism that goes beyond what currently exists. For this reason these
iterators are not programmed but, rather, hard-coded in the languages. However, this …
XML transformations are very sensitive to types: XML types describe the tags and attributes of XML elements as well as the number, kind, and order of their sub-elements. Therefore, operations, even simple ones, that modify these features may affect the types of documents. Operations on XML documents are performed by iterators that, to be useful, need to be typed by a kind of polymorphism that goes beyond what currently exists. For this reason these iterators are not programmed but, rather, hard-coded in the languages. However, this approach soon reaches its limits, as the hard-coded iterators cannot cover fairly standard usage scenarios.
As a solution to this problem we propose a generic language to define iterators for XML data. This language can either be used as a compilation target (e.g., for XPATH) or it can be grafted on any statically typed host programming language (as long as this has product types) to endow it with XML processing capabilities. We show that our language mostly offers the required degree of polymorphism, study its formal properties, and show its expressiveness and practical impact by providing several usage examples and encodings.
ACM Digital Library