Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » XSD » XML-Reader to ecore-mapping fails(using XML-Reader fails to read model correctly)
XML-Reader to ecore-mapping fails [message #690273] Wed, 29 June 2011 09:56
Frank Wiedemann is currently offline Frank WiedemannFriend
Messages: 5
Registered: July 2009
Junior Member
The XMLReader does not create a correct ecore-model:

I setup an mwe that reads a xml-File using with org.eclipse.xtend.typesystem.xsd.XMLReader. After that I wrote a xml-file with org.eclipse.xtend.typesystem.xsd.XMLWriter.

The ecore-model only contains an id-attribute which always contains the content of the second <ID>-element. The content of the first <ID>-element is always lost.

Here are snippets of the files:

xsd-file
<xs:element name="CHOICE">
	<xs:complexType>
	  <xs:sequence>
		<xs:element ecore:name="id" name="ID" type="ID1"/>
		<xs:choice>
		  <xs:element ref="DOT"/>
		  <xs:element ecore:name="choiceId" name="ID" type="ID1"/>
		</xs:choice>
		<xs:element ref="MEMBERS"/>
	  </xs:sequence>
	</xs:complexType>
</xs:element>


Original xml-File
<CHOICE>
  <ID>NameA</ID>
  <ID>NameB</ID>
  <MEMBERS>
	...
  </MEMBERS>
</CHOICE>


xml-File written by "org.eclipse.xtend.typesystem.xsd.XMLWriter"
<CHOICE>
  <ID>NameB</ID>
  <MEMBERS>
	...
  </MEMBERS>
</CHOICE>


can anyone help?
I expected two members. One with name id (with value of first <ID>-element) and one with name choiceId (with value of second <ID>-element).

Thanks in advance
Frank

Previous Topic:xmi to database
Next Topic:xml validation does not use latest xsd
Goto Forum:
  


Current Time: Wed Sep 18 19:55:34 GMT 2024

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

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

Back to the top