Skip to main content

A Pushdown Machine for Recursive XML Processing

  • Conference paper
Programming Languages and Systems (APLAS 2006)

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

Included in the following conference series:

Abstract

XML transformations are most naturally defined as recursive functions on trees. A naive implementation, however, would load the entire input XML tree into memory before processing. In contrast, programs in stream processing style minimise memory usage since it may release the memory occupied by the processed prefix of the input, but they are harder to write because the programmer is left with the burden to maintain a state. In this paper, we propose a model for XML stream processing and show that all programs written in a particular style of recursive functions on XML trees, the macro forest transducer, can be automatically translated to our stream processors. The stream processor is declarative in style, but can be implemented efficiently by a pushdown machine. We thus get the best of both worlds — program clarity, and efficiency in execution.

Partially supported by Comprehensive Development of e-Society Foundation Software of the Ministry of Education, Culture, Sports, Science and Technology, Japan.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Altinel, M., Franklin, M.J.: Efficient filtering of XML documents for selective dissemination of information. International Journal on Very Large Data Bases, 53–64 (2000)

    Google Scholar 

  2. Benzaken, V., Castagna, G., Frisch, A.: CDuce: an XML-centric general-purpose language. In: Proceedings of the 8th International Conference of Functional Programming, pp. 51–63 (2003)

    Google Scholar 

  3. Berlea, A., Seidl, H.: fxt – a transformation language for XML documents. Journal of Computing and Information Technology 10(1), 19–35 (2002)

    Article  MATH  Google Scholar 

  4. Cimprich, P., Becker, O., Nentwich, C., Jiroušek, M.K.H., Brown, P., Batsis, M., Kaiser, T., Hlavnička, P., Matsakis, N., Dolph, C., Wiechmann, N.: Streaming transformations for XML (STX) version 1.0., http://stx.sourceforge.net/

  5. Diao, Y., Franklin, M.J.: High-performance XML filtering: An overview of YFilter. IEEE Data Engineering Bulletin 26(1), 41–48 (2003)

    Google Scholar 

  6. Engelfriet, J., Vogler, H.: Macro tree transducers. Journal of Computer and System Sciences 31(1), 71–146 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  7. The Glasgow Haskell Compiler, http://www.haskell.org/ghc/

  8. Green, T.J., Gupta, A., Miklau, G., Onizuka, M., Suciu, D.: Processing XML streams with deterministic automata and stream indexes. ACM Transactions on Database Systems 29(4), 752–788 (2004)

    Article  Google Scholar 

  9. Gupta, A.K., Suciu, D.: Stream processing of XPath queries with predicates. In: Proceedings of the 2003 ACM SIGMOD International Conference on Management of Data, pp. 419–430 (2003)

    Google Scholar 

  10. Hosoya, H., Pierce, B.C.: Regular expression pattern matching for XML. Journal of Functional Programming 13(6), 961–1004 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  11. Hosoya, H., Pierce, B.C.: XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology 3(2), 117–148 (2003)

    Article  Google Scholar 

  12. Jones, S.P.: Space usage. Glasgow Haskell Users Mailing List (August 17, 2004), http://www.haskell.org/pipermail/glasgow-haskell-users/2004-August/007023.html

  13. Kay, M.: SAXON: The XSLTand XQuery processor, http://saxon.sourceforge.net/

  14. Kiselyov, O.: A better XML parser through functional programming. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 209–224. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Kodama, K., Suenaga, K., Kobayashi, N.: Translation of tree-processing programs into stream-processing programs based on ordered linear type. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 41–56. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  16. Ludäscher, B., Mukhopadhyay, P., Papakonstantinou, Y.: A transducer-based XML query processor. In: Proceedings of 28th International Conference on Very Large Data Bases, pp. 227–238 (2002)

    Google Scholar 

  17. Maneth, S., Berlea, A., Perst, T., Seidl, H.: XML type checking with macro tree transducers. In: Proceedings of 24th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 283–294 (2005)

    Google Scholar 

  18. Murata, M.: Extended path expressions of XML. In: Proceedings of the 20th ACM Symp. on Principles of Database Systems, pp. 153–166 (2001)

    Google Scholar 

  19. Nakano, K.: XTiSP: XML transformation language intended for stream processing, http://xtisp.org/

  20. Nakano, K.: Composing stack-attributed transducers. Technical Report METR-2004-01, Department of Mathematical Informatics. University of Tokyo (2004)

    Google Scholar 

  21. Nakano, K.: An implementation scheme for XML transformation languages through derivation of stream processors. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 74–90. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  22. Nakano, K., Mu, S.-C.: A pushdown machine for recursive XML processing (full version), http://www.ipl.t.u-tokyo.ac.jp/~ksk/en/?Publication

  23. The nhc98 compiler, http://www.haskell.org/nhc98/

  24. Nishimura, S.: Fusion with stacks and accumulating prameters. In: The 2004 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, pp. 101–112 (2004)

    Google Scholar 

  25. Nishimura, S., Nakano, K.: XML stream transformer generation through program composition and dependency analysis. Science of Computer Programming 54, 257–290 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  26. Perst, T., Seidl, H.: Macro forest transducers. Information Processing Letters 89, 141–149 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  27. Scherzinger, S., Kemper, A.: Syntax-directed transformations of XML streams. In: Workshop on Programming Language Technologies for XML, pp. 75–86 (2005)

    Google Scholar 

  28. Suenaga, K., Kobayashi, N., Yonezawa, A.: Extension of type-based approach to generation of stream-processing programs by automatic insertion of buffering primitives. In: Hill, P.M. (ed.) LOPSTR 2005. LNCS, vol. 3901, pp. 98–114. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  29. Wadler, P.: Fixing a space leak with a garbage collector. Software Practice and Experience 17(9), 595–608 (1987)

    Article  Google Scholar 

  30. Wadler, P.: Deforestation: Transforming programs to eliminate trees. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 344–358. Springer, Heidelberg (1988)

    Google Scholar 

  31. libxslt: the XSLT C library for Gnome, http://xmlsoft.org/XSLT/

  32. SAX: the simple API for XML, http://www.saxproject.org/

  33. XMark: an XML benchmark project, http://www.xml-benchmark.org/

  34. XSL: transformations (XSLT), http://www.w3c.org/TR/xslt/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Nakano, K., Mu, SC. (2006). A Pushdown Machine for Recursive XML Processing. In: Kobayashi, N. (eds) Programming Languages and Systems. APLAS 2006. Lecture Notes in Computer Science, vol 4279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11924661_21

Download citation

  • DOI: https://doi.org/10.1007/11924661_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-48937-5

  • Online ISBN: 978-3-540-48938-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics