skip to main content
10.1145/1190216.1190240acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Scrap your boilerplate with XPath-like combinators

Published:17 January 2007Publication History

ABSTRACT

XML programming involves idioms for expressing 'structure shyness' such as the descendant axis of XPath or the default templates of XSLT. We initiate a discussion of the relationships between such XML idioms and generic functional programming, while focusing on the (Haskell-based) 'Scrap your boilerplate' style of generic programming (SYB). This work gives insight into mechanisms for traversal and selection. We compare SYB and XSLT. We approximate XPath in SYB. We make a case for SYB's programmability, when compared to XPath's fixed combinators. We allude to strengthened type checking for SYB traversals so as to reject certain, trivial behaviors.

References

  1. D. Colazzo, G. Ghelli, P. Manghi, and C. Sartiani. Types for path correctness of XML queries. In ICFP'04, Proceedings, pages 126--137. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. English. HXML, 2002. Web site: http://www.flightlab.com/~joe/hxml/.Google ScholarGoogle Scholar
  3. T. Hallgren. Fun with functional dependencies. In Joint Winter Meeting of the Dep. of Science and Computer Eng., Chalmers University of Technology and Goteborg University, Varberg, Sweden, Jan. 2001. http://www.cs.chalmers.se/~hallgren/Papers/wm01.html.Google ScholarGoogle Scholar
  4. R. Hinze. A new approach to generic functional programming. In POPL'00, Proceedings, pages 119--132. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Hinze and J. Jeuring. Weaving a web. Journal of Functional Programming, 11(6):681--689, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Hinze, J. Jeuring, and A. Löh. Type-indexed data types. Science of Computer Programming, 51(1--2):117--151, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. P. Huet. The Zipper. Journal of Functional Programming, 7(5):549--554, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Jansson and J. Jeuring. PolyP--a polytypic programming language extension. In POPL'97, Proceedings, pages 470--482. ACM Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Kay. What kind of language is XSLT? IBM developerWorks, 2001--2005. http://www-128.ibm.com/developerworks/xml/library/x-xslt/?dwzone=x.Google ScholarGoogle Scholar
  10. M. Kay. Comparing XSLT and XQuery. In Proceedings of XTech 2005: XML, the Web and beyond, 2005. http://www.idealliance.org/proceedings/xtech05/papers/02-03-01/.Google ScholarGoogle Scholar
  11. O. Kiselyov and S. Krishnamurthi. SXSLT: Manipulation Language for XML. In V. Dahl and P. Wadler, editors, PADL'03, Proceedings, volume 2562 of LNCS, pages 256--272. Springer-Verlag, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. O. Kiselyov, R. Lämmel, and K. Schupke. Strongly typed heterogeneous collections. In Haskell Workshop 2004, Proceedings. ACM Press, Sept. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. Kiselyov and K. Lisovsky. XML, XPath, XSLT implementations as SXML, SXPath, and SXSLT, Sept. 2002. Presented at the International Lisp Conference (2002); http://okmij.org/ftp/.Google ScholarGoogle Scholar
  14. R. Lämmel and S. Peyton Jones. Scrap your boilerplate, website, http://www.cs.vu.nl/boilerplate/, 2003--2006.Google ScholarGoogle Scholar
  15. R. Lämmel, E. Visser, and J. Visser. Strategic programming meets adaptive programming. In AOSD'03, Proceedings, pages 168--177. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. J. Lieberherr, B. Patt-Shamir, and D. Orleans. Traversals of object structures: Specification and Efficient Implementation. ACM TOPLAS, 26(2):370--412, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. McBride. Faking It (Simulating Dependent Types in Haskell). Journal of Functional Programming, 12(4--5):375--392, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Microsoft Corp. XLinq overview, 2005. http://msdn.microsoft.com/netframework/future/linq/, Note that XLinq is now called 'LINQ to XML'.Google ScholarGoogle Scholar
  19. M. Neubauer, P. Thiemann, M. Gasbichler, and M. Sperber. A Functional Notation for Functional Dependencies. In Haskell Workshop 2001, Proceedings, ENTCS, pages 101--120. Elsevier, 2001.Google ScholarGoogle Scholar
  20. M. Neubauer, P. Thiemann, M. Gasbichler, and M. Sperber. Functional logic overloading. In POPL'02, Proceedings, pages 233--244. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. K. Normark. XML Transformations in Scheme with LAML--a Minimalistic Approach, Oct. 2003. Presented at the International Lisp Conference (2003); http://www.cs.aau.dk/~normark/laml/.Google ScholarGoogle Scholar
  22. T. Sheard and S. Peyton Jones. Template meta-programming for Haskell. In Haskell Workshop 2002, Proceedings, pages 1--16. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. E. Visser, Z. el Abidine Benaissa, and A. Tolmach. Building program optimizers with rewriting strategies. In ICFP'98, Proceedings, pages 13--26. ACM Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. W3C. Document Object Model (DOM), 1997--2003. http://www.w3.org/DOM/.Google ScholarGoogle Scholar
  25. W3C. XML Path Language (XPath), Version 1.0, W3C Recommendation, 16 Nov. 1999. http://www.w3.org/TR/xpath.Google ScholarGoogle Scholar
  26. W3C. XSL Transformations (XSLT), Version 1.0, W3C Recommendation, 16 Nov. 1999. http://www.w3.org/TR/xslt.Google ScholarGoogle Scholar
  27. W3C. XQuery 1.0: An XML Query Language, W3C Candidate Recommendation, 3 Nov. 2005. http://www.w3.org/TR/xquery/.Google ScholarGoogle Scholar
  28. W3C. XML Path Language (XPath), Version 2.0, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xpath20/.Google ScholarGoogle Scholar
  29. W3C. XQuery 1.0 and XPath 2.0 Formal Semantics, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xquery-semantics/.Google ScholarGoogle Scholar
  30. W3C. XSL Transformations (XSLT) Version 2.0, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xslt20/.Google ScholarGoogle Scholar
  31. M. Wallace and C. Runciman. Haskell and XML: generic combinators or type-based translation? In ICFP'99, Proceedings, pages 148--159. ACM Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Scrap your boilerplate with XPath-like combinators

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!