DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page xsi:type in EReference as Featurekind "element" wrong
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Oct 2009
Default xsi:type in EReference as Featurekind "element" wrong - 10-23-2009, 02:45 AM

Hi,

i have a problem with the eCore serization of models.

I need two kinds of link representation
1. Multible Links as attributes (works perfect)
2. Multible Links as elements <-- here is the problem
The links refere to an abstract class:

eCore always sets the xsi:type of the elements to the type of the target.
This is wrong becouse the type of the element should be anyURI (resp. the type of a link) and not to the type of the target.

When you validate the xml-file with the generated korrespondin schema you'll earn following error:
"cvc-elt.4.3: Type 'tttest:A' is not validly derived from the type definition, 'anyURI', of element 'classesElement'. My.tttechtest1 /Test1 line 8 XML Problem"

This error in is correct and ecore writes the wrong xsi:type.

When you set the "resolve proxy" for the reference to "false", the xsi:type is not written, but the link changes to IDREF.


here the Model:

<?xml version="1.0" encoding="UTF-8"?>
<tttest:Main
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tttest="www.tttech.tets/test1"
xsi:schemaLocation="www.tttech.tets/test1 Test1.xsd ">

<containingclasses xsi:type="tttest:A" name="a"
classesAttribute="#//@containingclasses[name='a'] #//@containingclasses[name='b']">

<classesElement xsi:type="tttest:A">#//@containingclasses[name='a']</classesElement>
<classesElement xsi:type="tttest:B">#//@containingclasses[name='b']</classesElement>
</containingclasses>
<containingclasses xsi:type="tttest:B" name="b"
classesAttribute="#//@containingclasses[name='a'] #//@containingclasses[name='b']" attrB="">

<classesElement xsi:type="tttest:A">#//@containingclasses[name='a']</classesElement>
<classesElement xsi:type="tttest:B">#//@containingclasses[name='b']</classesElement>
</containingclasses>
</tttest:Main>


here the Part of the model:

<eClassifiers xsi:type="ecore:EClass" name="Base" abstract="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="mixed"/>
</eAnnotations>

<eStructuralFeatures xsi:type="ecore:EAttribute"
name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>

<eStructuralFeatures xsi:type="ecore:EReference"
name="classesElement" upperBound="-1"
eType="#//Base" eKeys="#//Base/name">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
</eAnnotations>
</eStructuralFeatures>

<eStructuralFeatures xsi:type="ecore:EReference"
name="classesAttribute" upperBound="-1"
eType="#//Base" eKeys="#//Base/name">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
</eAnnotations>

</eStructuralFeatures>
</eClassifiers>

Have anyone an idea how to solve this incompatible / schema invalid problem.
My problem is that we use this xmls in two worlds (eclipse and outside), and I need a correct schemavalidation.


i attach the model, the schmema and the example

thanks a lot
andreas
Attached Files
File Type: zip model.zip (1.6 KB, 0 views)
Reply With Quote
Reply

Tags
emf xsd eclipse

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse Plugin Development: Changing Behavior Of "Open With XML Editor" anmorf Eclipse 0 04-20-2009 04:54 PM
"Special" folder layout for an EAR application - Migration from JBuilder doraemon Eclipse 1 11-13-2008 01:01 PM
Eclipse CDT "An internal error occurred during: "Launching"" aluminumpork Eclipse 1 10-08-2008 05:48 AM
Eclipse Debug error - "Process Model Delta" bboyle18 Eclipse 2 09-02-2008 08:20 PM
Error:"Cannot complete the request." while adding plugins using an update site. amit123solanki Eclipse 0 07-28-2008 08:33 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com