skip to main content
10.1145/1411204.1411210acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Typed iterators for XML

Published:20 September 2008Publication History

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.

Skip Supplemental Material Section

Supplemental Material

1411210.mp4

mp4

119.8 MB

References

  1. R. M. Amadio and L. Cardelli. Subtyping recursive types. ACM Trans. on Programming Languages, 15(4):575--631, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. V. Benzaken, G. Castagna, D. Colazzo, and K. Nguyen. Type-based XML projection. In VLDB 2006, pages 271--282, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. V. Benzaken, G. Castagna, and A. Frisch. CDuce: an XML-centric general-purpose language. In ICFP '03, pages 51--63, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. B. Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science, 25:95--169, 1983.Google ScholarGoogle ScholarCross RefCross Ref
  6. W3C: DTD specifications. http://www.w3.org/TR/REC-xml.Google ScholarGoogle Scholar
  7. A. Frisch. Regular tree language recognition with static information. In Proc. IFIP Conf. on Theor. Comput. Sci. (TCS). Kleuwer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  8. A. Frisch. OCaml + XDuce. SIGPLAN Not., 41(9):192--200, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. Frisch, G. Castagna, and V. Benzaken. Semantic Subtyping. In LICS '02, pages 137--146. IEEE Computer Society Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alain Frisch and Haruo Hosoya. Towards practial typechecking for macro tree transducers. In DBPL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. V. Gapeyev, M. Levin, and B. Pierce. Recursive subtyping revealed. Journal of Functional Programming, 12(6):511--548, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. V. Gapeyev, M. Y. Levin, B. C. Pierce, and A. Schmitt. The Xtatic experience. In PLAN-X, 2005.Google ScholarGoogle Scholar
  14. H. Hosoya. Regular expression filters for XML. In Programming Languages Technologies for XML (PLAN-X), pages 13--27, 2004.Google ScholarGoogle Scholar
  15. H. Hosoya, A. Frisch, and G. Castagna. Parametric polymorphism for XML. In POPL '05, pages 50--62, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. H. Hosoya and B.C. Pierce. Regular expression pattern matching for XML. In POPL '01, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. H. Hosoya and B.C. Pierce. XDuce: A typed XML processing language. In ACM Trans. on Internet Tech., pages 117--148, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Hosoya, J. Vouillon, and B. Pierce. Regular expression types for XML. In ICFP '00, volume 35(9) of SIGPLAN Notices, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. R. Lämmel. Scrap your boilerplate with XPath-like combinators. In POPL'07, Proceedings. ACM Press, January 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M.Y. Levin and B.C. Pierce. Type-based optimization for regular patterns. In DBPL '05, August 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. Maneth, A. Berlea, T. Perst, and H. Seidl. XML Type checking with macro tree transducers. In ACM PODS, pages 283--294, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Maneth, T. Perst, and H. Seidl. Exact XML type checking in polynomial time. In ICDT, pages 254--268, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. T. Milo, D. Suciu, and V. Vianu. Typechecking for XML transformers. J. Comput. Syst. Sci., 66(1), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M.-J. Nederhof. Practical experiments with regular approximation of context-free languages. Computat. Linguistics, 26(1):17--44, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Kim Nguyen. Combinator language for XML: design, typing, and implementation. PhD thesis, Université Paris-Sud 11, 2008.Google ScholarGoogle Scholar
  26. OASIS Committee Specification: Relax-NG. http://relaxng.org/Google ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Sulzmann and K. Zhuo Ming Lu. XHaskell. In PLAN-X, 2006.Google ScholarGoogle Scholar
  29. J. Vouillon. Polymorphic regular tree types and patterns. In POPL, pages 103--114, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Philip Wadler. Deforestation: Transforming programs to eliminate trees. Theor. Comput. Sci., 73(2):231--248, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. W3C: XML Schema. http://www.w3.org/XML/Schema.Google ScholarGoogle Scholar
  32. W3C: XML Path Language Ver. 1.0. http://www.w3.org/TR/xpath.Google ScholarGoogle Scholar

Index Terms

  1. Typed iterators for XML

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
          September 2008
          422 pages
          ISBN:9781595939197
          DOI:10.1145/1411204
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 43, Issue 9
            ICFP '08
            September 2008
            399 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1411203
            Issue’s Table of Contents

          Copyright © 2008 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 20 September 2008

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate333of1,064submissions,31%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader