Chapter 9. XML Schema

If you wish to create an object model for manipulating an XML data structure of some type, EMF provides a particularly desirable approach based on XML Schema. EMF can create an Ecore model that corresponds to a schema, allowing you to leverage the code generator, or dynamic EMF, to provide a Java API for manipulating instances of that schema.

At a high level, the mapping to Ecore is quite simple:

  • A schema maps to an EPackage.
  • A complex type definition maps to an EClass.
  • A simple type definition maps to an EDataType.
  • An attribute declaration or element declaration maps to an EAttribute if its type maps to an EDataType, or to an EReference if its type maps to an EClass.

From a modeling perspective, however, XML Schema is ...

Get EMF: Eclipse Modeling Framework Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.