Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD to Ecore(Reusing elements from XMLSchema namespace)
XSD to Ecore [message #514113] Fri, 12 February 2010 13:18 Go to next message
Oliver Normann is currently offline Oliver NormannFriend
Messages: 8
Registered: January 2010
Location: Berlin
Junior Member
Hello,

i would like to reuse the "documentation" element from the XMLSchema namespace.
I'm creating my Ecore model using the XSD first approach.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore".../>

<xsd:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" />

<xsd:complexType name="Documentation">
<xsd:sequence>
<xsd:element ref="xsd:documentation" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
...
</xsd:schema>

When i try to reload this XSD into the Generator model i'm not able to reference a Generator model for the XMLSchema definition. However a Generator model for the XMLNamespace definition exists in the "org.eclipse.emf.ecore" plugin which i can reference. This one is imported from XMLSchema definition and used by the "documentation" element.

Is there also a Generator model for the XMLSchema namespace which i could reference?

Greetings

Oliver

[Updated on: Fri, 12 February 2010 14:38]

Report message to a moderator

Re: XSD to Ecore [message #514138 is a reply to message #514113] Fri, 12 February 2010 14:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Oliver,

Comments below.

Oliver Normann wrote:
> Hallo,
>
> i would like to reuse the "documentation" element from the XMLSchema
> namespace.
I think that's a bad idea.
> I'm creating my Ecore model using the XSD first approach.
>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore".../>
>
> <xsd:import namespace="http://www.w3.org/2001/XMLSchema"
> schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" />
Then you'll need to drag in the whole XML Schema for Schemas model.
>
> <xsd:complexType name="Documentation">
> <xsd:sequence>
> <xsd:element ref="xsd:documentation" maxOccurs="unbounded" />
> </xsd:sequence>
> </xsd:complexType>
> ..
> </xsd:schema>
>
> When i try to reload this XSD into the Generator model i'm not able to
> reference a Generator model for the XMLSchema definition.
Indeed. There isn't one.
> However a Generator model for the XMLNamespace definition exists
> (which is imported from XMLSchema definition and used by the
> "documentation" element) which i can reference.
Yes, that's a schema I'd normally expect would be reused.
>
> Is there also a Generator model for the XMLSchema namespace which i
> could reference?
No. Build your own documentation support. Copy it if you need to, but
don't try to drag in a huge schema to use one part of it.
>
> Greetings
>
> Oliver


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD to Ecore [message #515202 is a reply to message #514138] Thu, 18 February 2010 07:30 Go to previous message
Oliver Normann is currently offline Oliver NormannFriend
Messages: 8
Registered: January 2010
Location: Berlin
Junior Member
Hi Ed,

Thanks for your fast reply. In the meantime i threw away the idea of importing XMLSchema namespace into my schema for just using a little part of it.

Indeed the generated Ecore model of XMLSchema is very large and i would'nt want to live with this. Furthermore it isn't a dedicated part of my domain.

So i've defined my own documentation type.

Thank you for clearance.

Greetings from Berlin
Oliver

[Updated on: Thu, 18 February 2010 07:34]

Report message to a moderator

Previous Topic:how to define a shared eStructuralFeatures
Next Topic:proxies won't be resolved
Goto Forum:
  


Current Time: Fri Apr 26 22:41:27 GMT 2024

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

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

Back to the top