Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » disable code generation for certain parts of XML Schema?
disable code generation for certain parts of XML Schema? [message #426097] Tue, 16 December 2008 10:37 Go to next message
Matthias is currently offline MatthiasFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

we are using EMF to parse XML files based on several XML schemas.
In our schema, we have this complexType:

<xsd:schema ...
xmlns:x="... other namespace defined by third-party schema ... "
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">

<xsd:complexType name="conditionType" ecore:featureMap="myCond">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="x:external" />
</xsd:sequence>
</xsd:complexType>

It refers to "m:external" which is defined by a third-party XML schema.
In our application, we would like to work with the conditionType by using
a general FeatureMap. We do not want to use EMF model code classes for the
content in the third-party schema.

Is it possible to disable the generation of model code for the third-party
schema, starting at x:external)?

Regards,
Matthias
Re: disable code generation for certain parts of XML Schema? [message #426101 is a reply to message #426097] Tue, 16 December 2008 10:56 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30904
Registered: July 2009
Senior Member
Matthias,

Comments below.

Matthias wrote:
> Hello,
>
> we are using EMF to parse XML files based on several XML schemas. In
> our schema, we have this complexType:
>
> <xsd:schema ... xmlns:x="... other namespace defined by
> third-party schema ... "
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
>
> <xsd:complexType name="conditionType" ecore:featureMap="myCond">
> <xsd:sequence minOccurs="1" maxOccurs="1">
> <xsd:element ref="x:external" />
> </xsd:sequence>
> </xsd:complexType>
>
> It refers to "m:external" which is defined by a third-party XML
> schema. In our application, we would like to work with the
> conditionType by using a general FeatureMap. We do not want to use EMF
> model code classes for the content in the third-party schema.
>
> Is it possible to disable the generation of model code for the
> third-party schema, starting at x:external)?
No. You could replace the element with a wildcard, <xsd:any
namespace="<third-party-namespace>"/> but that would allow any element
from that other namespace. Or you could define a schema with the third
party namespace where you just have <xsd:element name="external"/> and
nothing else, which would produce a minimal package for that namespace...
> Regards,
> Matthias
>
Previous Topic:[Basic EMF] Delete Command and references question
Next Topic:Stateful vs Singleton
Goto Forum:
  


Current Time: Wed Feb 26 05:08:04 GMT 2020

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

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

Back to the top