Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » generate genmodel from schema xml(problem when <xs:refefine> is used twice for one type)
generate genmodel from schema xml [message #633592] Mon, 18 October 2010 13:41 Go to next message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Hello everybody.

I tried to generate a genmodel from schema xml of ygraph.
You can find them at this adress :
http://www.yworks.com/en/downloads.html#yEd.
(in the GraphML - yFiles for Java XML Extension part)

the problem is that the file ygraphml.xsd, 2 type are redeine a second times,

For exemple :
in the file graphml.xsd we can find :
<xs:redefine schemaLocation="graphml-structure.xsd">
		<xs:attributeGroup name="key.extra.attrib">
			<xs:annotation>
				<xs:documentation source="http://graphml.graphdrawing.org/"
					xml:lang="en">
					Redefinition of file graphml-structure.xsd.
					Extends the attribute group key.extra.attrib (which takes
					part in the attribute list of &lt;key&gt;) by adding the
					attribute group key.attributes.attrib which is defined below.
				</xs:documentation>
			</xs:annotation>
			<xs:attributeGroup ref="key.extra.attrib" />
			<xs:attributeGroup ref="key.attributes.attrib" />
		</xs:attributeGroup>
...


so this file refefine the type "key.extra.attrib"
`
And in the file ygraphml.xsd :

<xs:redefine schemaLocation="graphml.xsd">

		<xs:attributeGroup name="key.extra.attrib">
			<xs:annotation>
				<xs:documentation>
					Redefinition of file graphml-structure.xsd.
					<p>Extends the attribute group key.extra.attrib (which takes
						part in
						the attribute list of &lt;key>) by adding the
						attribute yfiles.type
						which is defined below.
          </p>
				</xs:documentation>
			</xs:annotation>
			<xs:attributeGroup ref="key.extra.attrib" />
			<xs:attributeGroup ref="yfiles.foldertype.attrib" />
		</xs:attributeGroup>


the same attribute : "key.extra.attrib" is redefined a second time.

notice that an other attribute is redefined twice time : "node.extra.attrib"

So whan I try to generate an genmodel file from this xsd, I have this mistake :
Error: XSD: The attribute group may not be circularly defined ... :


IS it a mistake of EMF or of yworks that I can't generate the genmodel. eclipse said to me that all schemas are valide. And I don't modified them.

How can I resolve this problem?

Jérémie
Re: generate genmodel from schema xml [message #633652 is a reply to message #633592] Mon, 18 October 2010 16:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Jeremie,

Comments below.

jeremie wrote:
> Hello everybody.
>
> I tried to generate a genmodel from schema xml of ygraph.
> You can find them at this adress :
> http://www.yworks.com/en/downloads.html#yEd
> (in the GraphML - yFiles for Java XML Extension part)
>
> the problem is that the file ygraphml.xsd, 2 type are redeine a second
> times,
Goodness forbid, redefines are one of the worst abominations of XML
Schema. I think they've been deprecated in XML Schema 1.1 because
they'll so ill defined there seems to be no way to get them to work. Of
course when you try to map it to Java, which has no such nonsensical
concept, you're even worse off.
>
> For exemple :
> in the file graphml.xsd we can find :
>
> <xs:redefine schemaLocation="graphml-structure.xsd">
> <xs:attributeGroup name="key.extra.attrib">
> <xs:annotation>
> <xs:documentation
> source="http://graphml.graphdrawing.org/"
> xml:lang="en">
> Redefinition of file graphml-structure.xsd.
> Extends the attribute group key.extra.attrib
> (which takes
> part in the attribute list of <key>) by adding the
> attribute group key.attributes.attrib which is
> defined below.
> </xs:documentation>
> </xs:annotation>
> <xs:attributeGroup ref="key.extra.attrib" />
> <xs:attributeGroup ref="key.attributes.attrib" />
> </xs:attributeGroup>
> ..
>
>
> so this file refefine the type "key.extra.attrib"
> `
> And in the file ygraphml.xsd :
>
> <xs:redefine schemaLocation="graphml.xsd">
>
> <xs:attributeGroup name="key.extra.attrib">
> <xs:annotation>
> <xs:documentation>
> Redefinition of file graphml-structure.xsd.
> <p>Extends the attribute group key.extra.attrib
> (which takes
> part in
> the attribute list of <key>) by adding the
> attribute yfiles.type
> which is defined below.
> </p>
> </xs:documentation>
> </xs:annotation>
> <xs:attributeGroup ref="key.extra.attrib" />
> <xs:attributeGroup ref="yfiles.foldertype.attrib" />
> </xs:attributeGroup>
>
> the same attribute : "key.extra.attrib" is redefined a second time.
>
> notice that an other attribute is redefined twice time :
> "node.extra.attrib"
>
> So whan I try to generate an genmodel file from this xsd, I have this
> mistake :
>
> Error: XSD: The attribute group may not be circularly defined ... :
>
>
> IS it a mistake of EMF or of yworks that I can't generate the
> genmodel. eclipse said to me that all schemas are valide. And I don't
> modified them.
>
> How can I resolve this problem?
Someone ought to stop using redefine and simple define the right schema
in the first place. There's really nothing else I can suggest, because
I've given up trying to make redefine work "correctly" (and I use that
term loosely given correctness is not well defined) years ago...
>
> Jérémie
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: generate genmodel from schema xml [message #633829 is a reply to message #633652] Tue, 19 October 2010 14:35 Go to previous messageGo to next message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Thanks for your answer.

I changed the schemas and now it works.
EMF really don't like "redefine"

THanks for your help.

Jérémie
Re: generate genmodel from schema xml [message #933877 is a reply to message #633829] Fri, 05 October 2012 12:19 Go to previous messageGo to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi Jeremie,

I'm facing the same problem but I am much less experienced in handling xsd. I'm seeing that ygraphml.xsd redefines things in graphml.xsd which on its turn redefined parts of graphml-structure.xsd.

How did you proceed? Did you end up with 1 file containing everything? Or even better, do you have an eclipse project/plugin implementing the graphml meta model as used by yEd? I would definately be interested.

Greetings,
Wilbert.


Re: generate genmodel from schema xml [message #990800 is a reply to message #933877] Fri, 14 December 2012 10:25 Go to previous messageGo to next message
Andreas Brieg is currently offline Andreas BriegFriend
Messages: 48
Registered: November 2012
Member
I'm facing the same problem. Maybe this has something to do with https://issues.apache.org/jira/browse/XERCESJ-791.

[Updated on: Fri, 14 December 2012 10:27]

Report message to a moderator

Re: generate genmodel from schema xml [message #990805 is a reply to message #990800] Fri, 14 December 2012 10:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Andreas,

Sorry, but as I've said previously, I've given up trying to get redefine
to work sensibly.

On 14/12/2012 11:25 AM, Andreas Brieg wrote:
> I'm facing the same problem. Maybe this has something to do with
> https://issues.apache.org/jira/browse/XERCESJ-791.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: generate genmodel from schema xml [message #990851 is a reply to message #990805] Fri, 14 December 2012 13:31 Go to previous message
Andreas Brieg is currently offline Andreas BriegFriend
Messages: 48
Registered: November 2012
Member
I didn't want you to make redefines work properly, Ed. I was just collecting further information on this.

In the meanwhile I managed to get this working. I just merged the problematic redefines from http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd into http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd.
Previous Topic:[CDO] Multi master (clone)
Next Topic:Generated switch class and external interfaces
Goto Forum:
  


Current Time: Fri Apr 19 15:15:13 GMT 2024

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

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

Back to the top