Skip to main content

Integrating XPath with the Functional-Logic Language Toy

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6539))

Abstract

This paper presents a programming framework for incorporating XPath queries into the functional-logic language \(\mathcal{TOY}\). The proposal exploits the language characteristics, including non-determinism, logic variables, and higher-order functions and patterns. Our setting covers a wide range of standard XPath axes and tests. In particular reverse axes are implemented thanks to the double nature of XPath queries, which are both higher-order functions and data terms in our setting. The combination of these two different worlds, the functional-logic paradigm and the XML query language XPath, is very enriching for both of them. From the point of view of functional-logic programming, the language is now able to deal with XML documents in a very simple way. From the point of view of XPath, our approach presents several nice properties as the generation of XML test-cases for XPath queries, which can be useful for finding bugs in erroneous queries.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Almendros-Jiménez, J.M.: An Encoding of XQuery in Prolog. In: Bellahsène, Z., Hunt, E., Rys, M., Unland, R. (eds.) XSym 2009. LNCS, vol. 5679, pp. 145–155. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  2. Caballero, R., García-Ruiz, Y., Sáenz-Pérez, F.: Integrating XPath with the Functional-Logic Language Toy (Extended Version). Technical Report SIP-05/10, Facultad de Informática, Universidad Complutense de Madrid (2010), http://federwin.sip.ucm.es/sic/investigacion/publicaciones/pdfs/SIC-5-10.pdf

  3. Caballero, R., López-Fraguas, F.J.: A functional-logic perspective on parsing. In: Middeldorp, A. (ed.) FLOPS 1999. LNCS, vol. 1722, pp. 85–99. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  4. Guerra, R., Jeuring, J., Swierstra, S.D.: Generic validation in an XPath-Haskell data binding. In: Proceedings Plan-X (2005)

    Google Scholar 

  5. Hanus, M.: Curry: An Integrated Functional Logic Language (version 0.8.2) (March 28, 2006), http://www.informatik.uni-kiel.de/~mh/curry/ (2003)

  6. Huet, G.: The zipper. J. Funct. Program. 7(5), 549–554 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  7. Hutton, G., Meijer, E.: Monadic parsing in Haskell. J. Funct. Program. 8(4), 437–444 (1998)

    Article  MATH  Google Scholar 

  8. López-Fraguas, F.J., Hernández, J.S.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  9. Olteanu, D., Meuss, H., Furche, T., Bry, F.: XPath: Looking forward. In: Chaudhri, A.B., Unland, R., Djeraba, C., Lindner, W. (eds.) EDBT 2002. LNCS, vol. 2490, pp. 109–127. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  10. Sulzmann, M., Lu, K.Z.: Xhaskell — adding regular expression types to haskell. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 75–92. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  11. W3C. XML Schema 1.1

    Google Scholar 

  12. W3C. Extensible Markup Language, XML (2007)

    Google Scholar 

  13. W3C. XML Path Language (XPath) 2.0 (2007)

    Google Scholar 

  14. W3C. XQuery 1.0: An XML Query Language (2007)

    Google Scholar 

  15. Walmsley, P.: XQuery. O’Reilly Media, Inc., Sebastopol (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Caballero, R., García-Ruiz, Y., Sáenz-Pérez, F. (2011). Integrating XPath with the Functional-Logic Language Toy. In: Rocha, R., Launchbury, J. (eds) Practical Aspects of Declarative Languages. PADL 2011. Lecture Notes in Computer Science, vol 6539. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18378-2_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-18378-2_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-18377-5

  • Online ISBN: 978-3-642-18378-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics