Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Ecore to XSD
Ecore to XSD [message #602872] Tue, 04 March 2008 17:31
Vipul is currently offline VipulFriend
Messages: 6
Registered: July 2009
Junior Member
I want to generate the xsd from an Ecore file. I have written some code
which uses the EcoreSchemaBuilder to create the xsd file.

Here is the code snippet:

EPackage ePackage = getEPackage(ecoreFilePath);

ResourceSet resourceSet = new ResourceSetImpl();
XSDPackageImpl.eNS_URI, XSDPackageImpl.eINSTANCE);

ExtendedMetaData extendedMetaData = new BasicExtendedMetaData();
EcoreSchemaBuilder xsdBuilder = new EcoreSchemaBuilder(extendedMetaData);
XSDSchema xsd = xsdBuilder.getSchema(ePackage);

Resource xsdResource = resourceSet.createResource(URI

....code to save the xsd resource.......

My problem is that i donot need any ecore references in the xsd file. It
should be the plain xsd file without any ecore declaration in it.

Any pointers on this will really help.....

Thanks in advance,
Previous Topic:Create new DOM document from XSD schema
Next Topic:Eclipse : Write XML using XSD
Goto Forum:

Current Time: Sun Apr 22 11:05:48 GMT 2018

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

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