Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to model in XSD?
How to model in XSD? [message #55279] Mon, 25 September 2006 15:44 Go to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hey,

I'm having trouble with building a model for gmf in a xsd file.

I want to start off with a very simple model that contains only one type
of element that can then be associated with other elements (a directed
association) of the same type. The element will have some attributes (or
should these be elements?) as well but it's doing the association I don't
understand.

What I want to model is a simple dialogue that is divided into segments.
Each node to be a segment in a graph structure.


Is there any documentation on this? Cheers.

So something like:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
targetNamespace="http://www.example.org/dialoguegraph"
xmlns:dialoguegraph="http://www.example.org/dialoguegraph"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<xsd:complexType name="DialogueSegment">
<xsd:attribute name="intro_text" type="xsd:string"/> //set to max of one
<xsd:attribute name="transcript" type="xsd:string"/> //set to max of one
<xsd:attribute name="outro_text" type="xsd:string"/> //0..*
</xsd:complexType>

//set the relatonship between nodes?????

</xsd:schema>
Re: How to model in XSD? [message #55332 is a reply to message #55279] Mon, 25 September 2006 15:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------060004020504010204010907
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Gaff,

Probably you'll want to read this document:

XML Schema to Ecore Mapping
< http://www.eclipse.org/emf/docs/overviews/XMLSchemaToEcoreMa pping.pdf>

This EMF tutorial shows how ecore:reference in combination with anyURI
or IDREF can be used to define references between objects.

Tutorial: Generating an EMF Model using XML Schema
< http://dev.eclipse.org/viewcvs/indextools.cgi/*checkout*/org .eclipse.emf/doc/org.eclipse.emf.doc/tutorials/xlibmod/xlibm od.html>


Gaff wrote:

> Hey,
>
> I'm having trouble with building a model for gmf in a xsd file.
>
> I want to start off with a very simple model that contains only one
> type of element that can then be associated with other elements (a
> directed association) of the same type. The element will have some
> attributes (or should these be elements?) as well but it's doing the
> association I don't understand.
>
> What I want to model is a simple dialogue that is divided into
> segments. Each node to be a segment in a graph structure.
>
>
> Is there any documentation on this? Cheers.
>
> So something like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="http://www.example.org/dialoguegraph"
> xmlns:dialoguegraph="http://www.example.org/dialoguegraph"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
> <xsd:complexType name="DialogueSegment">
> <xsd:attribute name="intro_text" type="xsd:string"/> //set to max of one
> <xsd:attribute name="transcript" type="xsd:string"/> //set to max of one
> <xsd:attribute name="outro_text" type="xsd:string"/> //0..*
> </xsd:complexType>
>
> //set the relatonship between nodes?????
>
> </xsd:schema>
>


--------------060004020504010204010907
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gaff,<br>
<br>
Probably you'll want to read this document:<br>
<blockquote><a
href=" http://www.eclipse.org/emf/docs/overviews/XMLSchemaToEcoreMa pping.pdf">XML
Schema to Ecore Mapping</a><br>
</blockquote>
This EMF tutorial shows how ecore:reference in combination with anyURI
or IDREF can be used to define references between objects.<br>
<blockquote><a
href=" http://dev.eclipse.org/viewcvs/indextools.cgi/*checkout*/org .eclipse.emf/doc/org.eclipse.emf.doc/tutorials/xlibmod/xlibm od.html">Tutorial:
Generating an EMF Model using XML Schema</a><br>
</blockquote>
<br>
Gaff wrote:
<blockquote cite="mid4af494102978b95747fb7ee1a64f7860$1@www.eclipse.org"
type="cite">Hey,
<br>
<br>
I'm having
Re: How to model in XSD? [message #55706 is a reply to message #55332] Tue, 26 September 2006 09:58 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Cheers, the XML Schema to Ecore Mapping is good for the syntax but not
sure it really explains what needs to be in the file. Like, do I need to
have an abstract definition first that contains all other figures? Do I
need to state which is the diagram root element in the xsd file?

Is this kind of stuff explained anywhere?

To start with i'm just trying to get a node worknig by itself, the xsd is
below, I've tried getting an editor working with it and get as far as
ECore to GMFGraph, Diagram root element, as all the code is generated from
my model there must be something wrong with it:

(BTW, thanks for your hwelp ED)

<?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:complexType name="DiaSeg">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="intro"
type="xsd:string"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="transcript"
type="xsd:string"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="outro"
type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="alittlebit" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>
Re: How to model in XSD? [message #55735 is a reply to message #55706] Tue, 26 September 2006 12:07 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------000605080806030505000705
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Gaff,

I can't really answer questions about how you should model something
(since I don't really know what goal you are trying to achieve and don't
have the time). Typically its a good idea to define a global element for
anything you wish to serialize at the root of a document. If you
already know the model you want, but don't know how to write it as a
schema, you might want to try creating the Ecore model directly,
creating a GenModel for it, and then exporting the corresponding
schema. This demo might help:

http://adobedev.breezecentral.com/p17835008/

You should try to ask more specific questions because open ended ones
that require a long story are much less likely to get the kind of
information you are looking for...


Gaff wrote:
> Cheers, the XML Schema to Ecore Mapping is good for the syntax but not
> sure it really explains what needs to be in the file. Like, do I need
> to have an abstract definition first that contains all other figures?
> Do I need to state which is the diagram root element in the xsd file?
>
> Is this kind of stuff explained anywhere?
>
> To start with i'm just trying to get a node worknig by itself, the xsd
> is below, I've tried getting an editor working with it and get as far
> as ECore to GMFGraph, Diagram root element, as all the code is
> generated from my model there must be something wrong with it:
>
> (BTW, thanks for your hwelp ED)
>
> <?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:complexType name="DiaSeg">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="intro"
> type="xsd:string"/>
> <xsd:element maxOccurs="unbounded" minOccurs="0"
> name="transcript" type="xsd:string"/>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="outro"
> type="xsd:string"/>
> </xsd:sequence>
> <xsd:attribute name="alittlebit" type="xsd:string"/>
> </xsd:complexType>
> </xsd:schema>
>


--------------000605080806030505000705
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gaff,<br>
<br>
I can't really answer questions about how you should model something
(since I don't really know what goal you are trying to achieve and
don't have the time). Typically its a good idea to define a global
element for anything you wish to serialize at the root of a document.
Previous Topic:direct editing
Next Topic:UML2 example
Goto Forum:
  


Current Time: Sun Dec 22 01:09:12 GMT 2024

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

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

Back to the top