Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XML Generation and element hiding
XML Generation and element hiding [message #67811] Fri, 21 April 2006 09:49 Go to previous message
Guillaume Windels is currently offline Guillaume WindelsFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

I am looking for a way to simplify this bit of XML Schema. Namely, I
have an element which is not useful ("XXX"), but required ID-wise. The
purpose of this is to generate some XML.



<xsd:complexType name="listeningDataType" ecore:name="listeningData">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="unbounded" name="datas"
type="datasType"/>
</xsd:sequence>
<!-- Couple of attributes there -->
</xsd:complexType>

<xsd:complexType name="datasType" ecore:name="datas">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="dataId"
type="xsd:IDREF" ecore:reference="dataidtype"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="outputType" ecore:name="output">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="XXX"
type="dataidtype"/>
</xsd:sequence>
<!-- Couple of attributes there -->
</xsd:complexType>

<xsd:complexType name="dataidtype" ecore:name="dataId">
<xsd:sequence>
<xsd:element name="dataId" type="xsd:ID"/>
</xsd:sequence>
</xsd:complexType>

Using this schema, I end up with the following generated XML code (via
EMF):

<output [.. some attributes...]>
<XXX>
<dataId>myDataId</dataId>
</XXX>
</output>
<listeningdata [... some attributes ...]>
<datas>
<dataId>myDataId</dataId>
</datas>
</listeningdata>

As you can guess, I would like to get rid of the XML element "XXX", but
still would like to be able to include 'dataidtype' in 'output'.
Eventually, is there a way not to make it appear during the XML generation?
Any ideas?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:XSDImporter.java cannot run headless
Next Topic:getFacets() Vs getFacetContents()
Goto Forum:
  


Current Time: Sat Jul 22 09:04:48 GMT 2017

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

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