2-element XSD sequence model implementation [message #830410] |
Tue, 27 March 2012 11:33  |
Eclipse User |
|
|
|
Hi,
I'm trying to model the following XSD in Sapphire:
<xs:element name="resources">
<xs:complexType>
<xs:sequence>
<xs:element name="locale" type="Locale"></xs:element>
<xs:element name="bundle" maxOccurs="unbounded" type="ResourceBundle"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
I'd like the locale & bundle elements to have a 1:1 relationship, so I've created a container model element (IResourceLocaleBundle) which holds an implied element for each child element ("locale" and "bundle").
Parent list:
// *** ResourceLocaleBundles ***
@Type(base = IResourceLocaleBundle.class)
@Label(standard = "Resource Locale Bundles")
ListProperty PROP_RESOURCE_LOCALE_BUNDLES = new ListProperty(TYPE, "ResourceLocaleBundles");
ModelElementList<IResourceLocaleBundle> getResourceLocaleBundles();
Now, I'd like to bind the parent list property and IResourceLocaleBundle to nothing so that the locale and bundle elements appear coupled directly under the root element.
Should I be implementing a custom list & element binding impl for this purpose? Is there a better way to accomplish this?
I'd appreciate any comments.
Thanks,
Roded
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04078 seconds