Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » idrefs and holders
idrefs and holders [message #602610] Wed, 12 September 2007 11:09
Carsten Reckord is currently offline Carsten Reckord
Messages: 139
Registered: July 2009
Senior Member
Hi all,

I have two questions regarding binding of IDREF and IDREFS.

1. Is there a way to generally bind IDREF/S to references (to EObject or the like) instead of String attributes? I have a schema here that
makes frequent use of IDREFs without the referenced elements having a common super type, so I don't have any real type to use with
ecore:reference. By accident I found out that XSD will bind IDREFs to EObject if the type specified by ecore:reference doesn't exist in the
schema, so currently I have it working by using ecore:reference="ecore:EObject". But I'm wondering if there's a better way because this
seems a bit like exploiting a "loophole".

2. I have quite a few elements of the following form:

<xs:complexType name="Accessory_occurrence">
<xs:sequence>
<xs:element name="Reference_element" type="xs:IDREFS"
ecore:reference="kbl:Connector_occurrence"/>
...
</xs:sequence>
</xs:complexType>

XSD will generate a holder class ReferenceElementHolder for this. While I can see that this makes sense in case of the element having an
upper bound > 1, I don't think it is necessary here. And it really makes the API ugly because I have quite a lot of those to deal with. So
I'd like to know if there's an easy way to get rid of those holders in this case or if I'd have to write custom XMLSave and XMLHandler classes.

Thanks,
Carsten
Previous Topic:How to retrieve the xml encoding from the schema
Next Topic:idrefs and holders
Goto Forum:
  


Current Time: Thu Sep 18 07:52:37 GMT 2014

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

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