Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Authoring XML Schemas for use with EMF"
m |
|||
Line 8: | Line 8: | ||
Luckily, both Ecore models and XML Schemas have support for annotations. Annotations can be almost anything, but for this discussion, annotations will serve two main purposes | Luckily, both Ecore models and XML Schemas have support for annotations. Annotations can be almost anything, but for this discussion, annotations will serve two main purposes | ||
− | * one | + | * Provide additional information when transforming one metamodel to another |
− | * | + | * Provide additional information on how to serialize/deserialize an EMF Resource, Object, Attribute, Datatype, etc. |
= The Relationship between Elements, Types, and EClasses = | = The Relationship between Elements, Types, and EClasses = |
Revision as of 19:48, 12 June 2007
Contents
Abstract
This article focuses on authoring and using XML Schemas for the purpose of generating an EMF model.
Overview
An EMF Model (files of type *.genmodel) is the hub for importing/exporting other metamodel formats, linking to other EMF models, and generating implementation code. Out-of-the-box, EMF can import XML Schema Definitions (XSDs) into Ecore Models (files of type *.ecore). Similarly, EMF can export Ecore Models to XSDs. But without some additional information, EMF uses a default set of transformations that rarely yields the desired mapping.
Luckily, both Ecore models and XML Schemas have support for annotations. Annotations can be almost anything, but for this discussion, annotations will serve two main purposes
- Provide additional information when transforming one metamodel to another
- Provide additional information on how to serialize/deserialize an EMF Resource, Object, Attribute, Datatype, etc.
The Relationship between Elements, Types, and EClasses
Mapping <xsd:attribute> to EAttribute
Using Substitution Groups
--Hudsonr.us.ibm.com 14:26, 12 June 2007 (EDT)