Conversion to ATerms with knowledge of a schema for the XML document is called interpretation of XML against a schema. This kind of conversion is work in pogress, xml-tools already comes with xml-interpret, a proof of concept of XML interpretation.

XML interpretation gives the XML instance document much more structure:

  • introduction of lists and tuples
  • Optional content is represented with None or Some(_)
  • introduction of integers

XML interpretation is based on regular tree grammars. A schema in a specific schema language like a Document Type Definition, Stratego signature? or SDF syntax definition (with annotated constructur names), is transformed into a regular tree grammar (rtg). The concrete syntax? and abstract syntax? of the rtg language is defined in the package stratego-regular.

Relation to XML data binding

XML interpretation is related to XML data binding, where XML documents are mapped to data structures that provide a more natural reperesentation of the document in a certain programming language. In a certain way the more structured representation of the XML document in an Stratego.ATerm is the natural representation of the document in Stratego.

XML interpretation is however different from XML data binding because the Stratego.ATerm format is just like XML and exchange format for structured data. XML data binding provides a natural mapping into data structures of a programming languages, XML interpretation is not specific to a certain programming language: it provides a natural mapping from XML to the Stratego.ATerm exchange format.


Revision: r1.5 - 28 Apr 2005 - 22:24 -
Tools > StrategoXML > XmlTools > XmlInterpretation
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback