XML Generation and element hiding [message #597987] |
Fri, 21 April 2006 09:49 |
Guillaume Windels 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?
|
|
|
Powered by
FUDForum. Page generated in 0.02818 seconds