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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Scalable vector graphics (SVG) 1.1 specification (January 2003), http://www.w3.org/TR/SVG11/
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)
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)
Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 10(2), 235–271 (1992)
Flanagan, C., Freund, S., Qadeer, S.: Exploiting purity for atomicity. IEEE Transactions on Software Engineering 31(4) (April 2005)
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)
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)
Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 205–229. Springer, Heidelberg (1999)
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)
Le Hégaret, P., Whitmer, R., Wood, L.: W3C document object model (August 2003), http://www.w3.org/DOM/
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)
Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)
Skalka, C.: Trace effects and object orientation. In: Proceedings of the ACM Conference on Principles and Practice of Declarative Programming, Lisbon, Portugal (July 2005)
Walker, D.: Substructural type systems. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages, ch. 1. MIT Press, Cambridge (2005)
Wright, A., Felleisen, M.: A syntactic approach to type soundness. Information and Computation 115(1), 38–94 (1994)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)