modelling in XSD? [message #56373] |
Wed, 27 September 2006 09:08  |
Eclipse User |
|
|
|
Hi all,
I'm trying to make a simple model in XSD so i can learn what is happening
in gmf. Just want to the model to have a single node that can be added to
the, with some aritrary attributes. The xsd file is below, I've used it to
create all gmf code that is necessary following the cheat sheets for
mindmap as I go. All seems to be fine until I try to launch the new
eclipse workbench, get msg error exist in required project:
org.eclipse.gmf.simpleg2.diagram. Continue to Launch? When I try to create
a simpleg2 diagram I have internal errors:
java.lang.NullPointerException
at
org.eclipse.emf.transaction.util.TransactionUtil.getEditingD omain(TransactionUtil.java:50)
....
....
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
The same workbench is fine for mindmap diagrams so there must be something
wrong with how I've modelled the xsd (which I thought was just a simpler
version of mindmap so would surely work?)?
XSD FILE:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:mindmap="http://www.example.org/mindmap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<xsd:element name="map" type="simpleg:Map"/>
<xsd:complexType name="Map">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="DiaSeg"
type="simpleg:Topic"/>
</xsd:sequence>
<xsd:attribute name="title" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="DiaSeg">
<xsd:attribute name="intro" type="simpleg:string"/>
<xsd:attribute name="transcript" type="simpleg:string"/>
<xsd:attribute name="outro" type="simpleg:string"/>
</xsd:complexType>
</xsd:schema>
|
|
|
|
|
|
Re: modelling in XSD? [message #57109 is a reply to message #56975] |
Thu, 28 September 2006 08:49  |
Eclipse User |
|
|
|
Hi Gaff,
I think I had the same problem once. Could it be, that you have chosen a
wrong DocumentRoot during generation?
I'm not quite sure how I managed to get rid of this error, but maybe you
should delete all generated code and start all over with
EMF-Modelcode-generation and then GMF generation? I know it's
brute-force, but sometimes that should do just right!!
greets Alex
Gaff wrote:
> Problem is in scr, in the Simple2DiagramEditorUtil.java, under setnull
> function, but again if this is all generated code from my model could
> someone tell me where I'm going wrong with my model? TY
>
> private static EObject createInitialRoot(DocumentRoot model) {
> DocumentRoot docRoot =
> Simpleg2Factory.eINSTANCE.createDocumentRoot();
> docRoot.setnull(model);
> return docRoot;
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03924 seconds