Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » XSD 2 Ecore with Xpand(XSD 2 Ecore with Xpand)
XSD 2 Ecore with Xpand [message #1005918] Tue, 29 January 2013 05:02 Go to next message
Eclipse UserFriend
Hi,

I want to use xpand for xsd 2 ecore.

But i have problem because my xsd metamodel is larger meaning of ecore.

Ecore dont support inner class system. But my XSD metamodel have inner

class hierarchy. Because of these i must convert inner class to 2 different classes.

Problem is start here. When i see inner class i must write

this class out of its parent and must be reference to its parent. So i have list of

inner classes and later when parent class text finished i must implement these

clases. But this approach is complex. Question is;

How can i use ecore api or something to create ecore simple ?

Not: I dont want to create .ecore file with text(xml)value i just need to use library or somethink else to create ecore can u help me with this ?

my template sample;

«DEFINE Root FOR ir::IModule»
	«FILE moduleName(name) + ".ecore"»<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name= "«moduleName(name)»" nsURI="http://«moduleName(name)»/1.0" nsPrefix="«moduleName(name)»">
    «EXPAND EClass FOREACH clafers()»
</ecore:EPackage>
	«ENDFILE»
«ENDDEFINE»


[Updated on: Tue, 29 January 2013 06:29] by Moderator

Re: XSD 2 Ecore with Xpand [message #1006396 is a reply to message #1005918] Thu, 31 January 2013 04:00 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: XSD 2 Ecore with Xpand [message #1006398 is a reply to message #1005918] Thu, 31 January 2013 04:08 Go to previous message
Eclipse UserFriend
Serhat,

I don't really understand what you wrote, sorry.

Your task is to map an XSD to Ecore, right? For this task you would not need Xpand, there is a standard mapping implementation in EMF XSD, see class org.eclipse.xsd.ecore.XSDEcoreBuilder.XSDEcoreBuilder.

Xpand's XSD typesystem uses this class to derive types from XSD, it might be worth at the sources in the plugin org.eclipse.xtend.typesystem.xsd, especially class OawXSDEcoreBuilder, XSDMetaModel.

Note also this blog entry: http://www.svenlange.co.za/2013/01/avoid-name-collision-in-ecore-generated-from-xsd/

Hope this helps,
~Karsten

Previous Topic:[ACCELEO] maven repo for juno ?
Next Topic:org.eclipse.emf.mwe.utils.Reader is not reading stereotype
Goto Forum:
  


Current Time: Thu Jul 10 01:52:46 EDT 2025

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

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

Back to the top