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.
Supplemental Material
Available for Download
Supplemental material for: Typed iterators for XML
- R. M. Amadio and L. Cardelli. Subtyping recursive types. ACM Trans. on Programming Languages, 15(4):575--631, 1993. Google Scholar
Digital Library
- V. Benzaken, G. Castagna, D. Colazzo, and K. Nguyen. Type-based XML projection. In VLDB 2006, pages 271--282, 2006. Google Scholar
Digital Library
- V. Benzaken, G. Castagna, and A. Frisch. CDuce: an XML-centric general-purpose language. In ICFP '03, pages 51--63, 2003. Google Scholar
Digital Library
- V. Benzaken, G. Castagna, and C. Miachon. A full pattern-based paradigm for XML query processing. In PADL 05, number 3350 in LNCS, pages 235--252, 2005. Google Scholar
Digital Library
- B. Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science, 25:95--169, 1983.Google Scholar
- W3C: DTD specifications. http://www.w3.org/TR/REC-xml.Google Scholar
- A. Frisch. Regular tree language recognition with static information. In Proc. IFIP Conf. on Theor. Comput. Sci. (TCS). Kleuwer, 2004.Google Scholar
Cross Ref
- A. Frisch. OCaml + XDuce. SIGPLAN Not., 41(9):192--200, 2006. Google Scholar
Digital Library
- A. Frisch, G. Castagna, and V. Benzaken. Semantic Subtyping. In LICS '02, pages 137--146. IEEE Computer Society Press, 2002. Google Scholar
Digital Library
- A. Frisch, G. Castagna, and V. Benzaken. Semantic subtyping: dealing set-theoretically with function, union, intersection, and negation types. The Journal of ACM, 2008. To appear. Google Scholar
Digital Library
- Alain Frisch and Haruo Hosoya. Towards practial typechecking for macro tree transducers. In DBPL, 2007. Google Scholar
Digital Library
- V. Gapeyev, M. Levin, and B. Pierce. Recursive subtyping revealed. Journal of Functional Programming, 12(6):511--548, 2003. Google Scholar
Digital Library
- V. Gapeyev, M. Y. Levin, B. C. Pierce, and A. Schmitt. The Xtatic experience. In PLAN-X, 2005.Google Scholar
- H. Hosoya. Regular expression filters for XML. In Programming Languages Technologies for XML (PLAN-X), pages 13--27, 2004.Google Scholar
- H. Hosoya, A. Frisch, and G. Castagna. Parametric polymorphism for XML. In POPL '05, pages 50--62, 2005. Google Scholar
Digital Library
- H. Hosoya and B.C. Pierce. Regular expression pattern matching for XML. In POPL '01, 2001. Google Scholar
Digital Library
- H. Hosoya and B.C. Pierce. XDuce: A typed XML processing language. In ACM Trans. on Internet Tech., pages 117--148, 2003. Google Scholar
Digital Library
- H. Hosoya, J. Vouillon, and B. Pierce. Regular expression types for XML. In ICFP '00, volume 35(9) of SIGPLAN Notices, 2000. Google Scholar
Digital Library
- R. Lämmel. Scrap your boilerplate with XPath-like combinators. In POPL'07, Proceedings. ACM Press, January 2007. Google Scholar
Digital Library
- M.Y. Levin and B.C. Pierce. Type-based optimization for regular patterns. In DBPL '05, August 2005. Google Scholar
Digital Library
- S. Maneth, A. Berlea, T. Perst, and H. Seidl. XML Type checking with macro tree transducers. In ACM PODS, pages 283--294, 2005. Google Scholar
Digital Library
- S. Maneth, T. Perst, and H. Seidl. Exact XML type checking in polynomial time. In ICDT, pages 254--268, 2007. Google Scholar
Digital Library
- T. Milo, D. Suciu, and V. Vianu. Typechecking for XML transformers. J. Comput. Syst. Sci., 66(1), 2003. Google Scholar
Digital Library
- M.-J. Nederhof. Practical experiments with regular approximation of context-free languages. Computat. Linguistics, 26(1):17--44, 2000. Google Scholar
Digital Library
- Kim Nguyen. Combinator language for XML: design, typing, and implementation. PhD thesis, Université Paris-Sud 11, 2008.Google Scholar
- OASIS Committee Specification: Relax-NG. http://relaxng.org/Google Scholar
- M. Sulzmann and K. Zhuo Ming Lu. A type-safe embedding of XDuce into ML. El. Notes Theor. Comp. Sci., 148(2):239--264, 2006. Google Scholar
Digital Library
- M. Sulzmann and K. Zhuo Ming Lu. XHaskell. In PLAN-X, 2006.Google Scholar
- J. Vouillon. Polymorphic regular tree types and patterns. In POPL, pages 103--114, 2006. Google Scholar
Digital Library
- Philip Wadler. Deforestation: Transforming programs to eliminate trees. Theor. Comput. Sci., 73(2):231--248, 1990. Google Scholar
Digital Library
- W3C: XML Schema. http://www.w3.org/XML/Schema.Google Scholar
- W3C: XML Path Language Ver. 1.0. http://www.w3.org/TR/xpath.Google Scholar
Index Terms
Typed iterators for XML
Recommendations
Typed iterators for XML
ICFP '08XML 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 ...
Parametric polymorphism for XML
Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesDespite the extensiveness of recent investigations on static typing for XML, parametric polymorphism has rarely been treated. This well-established typing discipline can also be useful in XML processing in particular for programs involving "parametric ...
Parametric polymorphism for XML
Despite the extensiveness of recent investigations on static typing for XML, parametric polymorphism has rarely been treated. This well-established typing discipline can also be useful in XML processing in particular for programs involving “parametric ...







Comments