Skip to main content

A Type Safe DOM API

  • Conference paper
Book cover Database Programming Languages (DBPL 2005)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 3774))

Included in the following conference series:

Abstract

DOM (Document Object Model) is the W3C recommendation for an API for manipulating XML documents. The API is stated in terms of a language neutral IDL with normative bindings given for Java and ECMAScript. The type system underlying the DOM API is a simple object-based one which relies entirely on interfaces and interface extension. However, this simplicity is deceiving because the DOM architects implicitly impose a large number of constraints which are only stated informally. The long list of exceptions that some DOM methods may raise witnesses these constraints.

The present work defines a refinement of Java’s type system which makes most of these constraints accessible and thus checkable to the compiler. Technically, we graft a polymorphic annotation system on top of the host language’s types and propagate the annotations using ideas borrowed from affine type systems. We provide a type soundness proof with respect to an operational semantics of a Java core language.

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. Scalable vector graphics (SVG) 1.1 specification (January 2003), http://www.w3.org/TR/SVG11/

  2. Bierman, G.M., Parkinson, M.J., Pitts, A.M.: An imperative core calculus for Java and Java with effects. Technical Report 563, University of Cambridge Computer Laboratory (April 2003)

    Google Scholar 

  3. Drossopoulou, S., Eisenbach, S.: Java is type safe—probably. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 389–418. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  4. Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 10(2), 235–271 (1992)

    Article  MathSciNet  Google Scholar 

  5. Flanagan, C., Freund, S., Qadeer, S.: Exploiting purity for atomicity. IEEE Transactions on Software Engineering 31(4) (April 2005)

    Google Scholar 

  6. Flatt, M., Krishnamurthi, S., Felleisen, M.: A programmer’s reduction semantics for classes and mixins. In: Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. LNCS, vol. 1523, pp. 241–269. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  7. Ghiya, R., Hendren, L.J.: Is it a tree, a DAG, or a cyclic graph? a shape analysis for heap-directed pointers in C. In: Proceedings of the 1996 ACM SIGPLAN Symposium on Principles of Programming Languages, St. Petersburg, FL, USA, January 1996, pp. 1–15. ACM Press, New York (1996)

    Chapter  Google Scholar 

  8. Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 205–229. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  9. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)

    Article  Google Scholar 

  10. Le Hégaret, P., Whitmer, R., Wood, L.: W3C document object model (August 2003), http://www.w3.org/DOM/

  11. Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Proc. 15th Annual ACM Symposium on Principles of Programming Languages, San Diego, California, January 1988, pp. 47–57. ACM Press, New York (1988)

    Chapter  Google Scholar 

  12. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)

    MATH  Google Scholar 

  13. Skalka, C.: Trace effects and object orientation. In: Proceedings of the ACM Conference on Principles and Practice of Declarative Programming, Lisbon, Portugal (July 2005)

    Google Scholar 

  14. Walker, D.: Substructural type systems. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages, ch. 1. MIT Press, Cambridge (2005)

    Google Scholar 

  15. Wright, A., Felleisen, M.: A syntactic approach to type soundness. Information and Computation 115(1), 38–94 (1994)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Thiemann, P. (2005). A Type Safe DOM API. In: Bierman, G., Koch, C. (eds) Database Programming Languages. DBPL 2005. Lecture Notes in Computer Science, vol 3774. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11601524_11

Download citation

  • DOI: https://doi.org/10.1007/11601524_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-30951-2

  • Online ISBN: 978-3-540-31445-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics