Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Generates an XSD with annotations from an ECore model
Generates an XSD with annotations from an ECore model [message #596883] Mon, 10 October 2005 14:31
Julien is currently offline JulienFriend
Messages: 15
Registered: July 2009
Junior Member
I build an ECore model which uses EAnnotation. And when I generate an XSD
file from my ECore model, the Annotations are not added.

EPackage myPackage = EcoreFactory.eINSTANCE.createEPackage();
// documentList is a list of EClassifier

EAnnotation myAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
myAnnotation.getDetails().put("ecore:isRootDocument", "true");

// XMLSchema building
EcoreXMLSchemaBuilder xmlSchemaBuilder = new EcoreXMLSchemaBuilder();
Collection resultXmlSchemaBuilder = xmlSchemaBuilder.generate(myPackage);

// Register XML resource factory
org.eclipse.emf.ecore.resource.Resource resource = new


Map properties = new HashMap();
properties.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
try {;
} catch (IOException e) {
ExceptionHandler.processException(e, null);
Previous Topic:resolve XSDSimpleTypeDefinition
Next Topic:How to print logical view of schema?
Goto Forum:

Current Time: Sat Jan 23 02:50:40 GMT 2021

Powered by FUDForum. Page generated in 0.01330 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top