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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.