XSD -> ECORE conversion : problem with XSD inclusion [message #600610] |
Thu, 04 January 2007 10:49 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02795 seconds