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
>

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.