Typed iterators for XML

  • Authors:
  • Giuseppe Castagna;Kim Nguyen

  • Affiliations:
  • Université Paris 7, Paris, France;Université Paris-Sud 11, Orsay, France

  • Venue:
  • Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.