Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » XSD -> ECORE conversion : problem with XSD inclusion
XSD -> ECORE conversion : problem with XSD inclusion [message #600610] Thu, 04 January 2007 10:49
Eclipse UserFriend
Originally posted by: turmeau.laurent.fmtls.siemensvdo.com

Hello,

I'm creating an EMF project, and the ECORE model is imported from a XML
schema.
This XML schema includes another one like this:

test.xsd

<xs:schema xmlnss="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="template_declaration.xsd"/>
<xs:element name="TOTO">
<xs:complexType>
<xs:sequence>
<xs:element ref="TITI_1" minOccurs="0"/>
<xs:element ref="TITI_2" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="Name" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

The ECORE model is generated successfully, but the Root package is
templateDeclaration whereas TOTO is expected.

I tried to avoid this, using ecore directives in the XSD to force the
generated package name. it gives something like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
ecore:package="TOTO"
ecore:nsPrefix="TOTO">
<xs:include schemaLocation="template_declaration.xsd"/>
...

Now, a TOTOPackage interface is generated, that defines:

String eNAME = "TOTO";
String eNS_URI =
" file:/C:/DATA/WICO_TLS/CongaConfig/xsd/template_declaration. xsd ";
String eNS_PREFIX = "TOTO";

The URI is not correct: test.xsd is expected. Indeed, when I try to load a
XML resource, EMF tries to map the XML against the
template_declaration.xsd. And it fails.

Has anybody encountered this problem?
regards

Laurent
Previous Topic:Re: CompoundCommand failure results in "Transaction is already closed" IllegalStateExcepti
Next Topic:How can i set xmi:id in emf?
Goto Forum:
  


Current Time: Thu Apr 25 16:59:53 GMT 2024

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

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

Back to the top