1
Suggestions and Requests / Re: Additional eléments for XML schema toolbox
« on: March 03, 2006, 06:52:46 am »
I've been thinking about this some more - and while it would be really nice to have some association stereotype that visually associated element components and generated the appropriate key/keyref declarations, there is a very simple way that this could be supported.
If you look at what the generated code looks like, it should be pretty obvious how to provide basic support.
<xs:complexType name="foo">
<xs:sequence>
...
<xs:attribute name="foo_ID" type="string"/>
</xs:complexType>
<xs:element name="foo_impl" type="foo">
<xs:key name="foo_primary_key">
<xs:selector xpath="foo"/>
<xs:field xpath="@foo_ID"/>
</xs:key>
</xs:element>
The complexType and element would be modelled as normal, but the element stereotype would have an extra dropdown data entry field with options (null);unique;key;keyref. Selecting a non-null option would reveal extra data entry fields for name, path, refer and selector as appropriate. While it would be nice to have these extra fields restricted to declared keys/attributes it is certainly not necessary.
Steve
If you look at what the generated code looks like, it should be pretty obvious how to provide basic support.
<xs:complexType name="foo">
<xs:sequence>
...
<xs:attribute name="foo_ID" type="string"/>
</xs:complexType>
<xs:element name="foo_impl" type="foo">
<xs:key name="foo_primary_key">
<xs:selector xpath="foo"/>
<xs:field xpath="@foo_ID"/>
</xs:key>
</xs:element>
The complexType and element would be modelled as normal, but the element stereotype would have an extra dropdown data entry field with options (null);unique;key;keyref. Selecting a non-null option would reveal extra data entry fields for name, path, refer and selector as appropriate. While it would be nice to have these extra fields restricted to declared keys/attributes it is certainly not necessary.
Steve