Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] Generating EMF from XSD Error


Rajesh,

Please use the newsgroup rather than the mailing list to ask question.

You can use annotations to control the package name as described in:

http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E/emf-home/docs/overviews/XMLSchemaToEcoreMapping.pdf

You can also control the Prefix that's used on the XyzPackage in the Generator by changing it for the GenPackage before you generate the code.




Ed Merks/Toronto/IBM@IBMCA
mailto: merks@xxxxxxxxxx
905-413-3265  (t/l 969)




Rajesh Jain <rjain15@xxxxxxxxx>
Sent by: emf-dev-admin@xxxxxxxxxxx

02/17/2005 12:32 PM

Please respond to
emf-dev

To
emf-dev@xxxxxxxxxxx
cc
rajesh.jain@xxxxxxxxxxxxx
Subject
[emf-dev] Generating EMF  from XSD Error





I have XSD files which I am trying to pull into
Eclipse to build a EMF model. These XSD files have
Version Number in the NMLNS, which I believe is used
to create the package names.

I am attaching a sample XSD file which I am trying to
pull in.

The Code that is generated has the following package
structure


oasis/names/specification/ubl/schema/xsd/ChannelCode/_1/_0

The header of the XSD file is :
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 
xmlns="urn:oasis:names:specification:ubl:schema:xsd:ChannelCode-1.0"
 
xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-1.0"
 
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:ChannelCode-1.0"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified"
   version="1.0">


The Factory class and the Package Class has the names
_0Factory and _OPackage

When I do a generate All, the Corrosponding
ModelWizard
has the name _OModelWizard, and there is a error in
the generated Code because of the Name

protected _0Package _0Package = _0Package.eINSTANCE;

Cannot reference _OPackage before it is defined
(because of the naming)


My Question is,can it be possible

a) To drop the Version Numbers from during Generation
of Code (from the Package, Factory, Package Structure,
Model Wizard)

b) To Concatenate Version number with Class Name

c) Generate the Correct Names i.e.
ChannelCodeFactory
ChannelCodeModelWizard
ChannelCodePackage

Or am I missing something?

regards
Rajesh
  [attachment "UBL-CodeList-AllowanceChargeReasonCode-1.0.xsd" deleted by Ed Merks/Toronto/IBM]


Back to the top