Generic validation of structural content with parametric modules

  • Authors:
  • Tyng-Ruey Chuang

  • Affiliations:
  • Academia Sincia, Taipei, Taiwan

  • Venue:
  • Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2001

Quantified Score

Hi-index 0.01

Visualization

Abstract

We demonstrate a natural mapping from XML element types to ML module expressions. The mapping is inductive and definitions of common XML operations can be derived as the module expressions are composed. We show how to derive, in a generic way, the validation function, which checks an XML document for conformance to its DTD (Document Type Definition). One can view validation as assigning ML types to XML elements and the validation procedure a pre-requisite for typeful XML programming in ML. Our mapping uses the parametric module facility of ML in some contrived way. For example, in validating WML (WAP Markup Language) documents, we need to use 36ary type constructors, as well as higher-order modules that take in as many as 17 modules as input. That one can systematically model XML DTDs at the module level suggests ML-like languages are suitable for type-safe prototyping of DTD-aware XML applications.