Book a Demo

Author Topic: Additional eléments for XML schema toolbox  (Read 5337 times)

Paule

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Additional eléments for XML schema toolbox
« on: November 21, 2005, 05:12:29 am »
Hello,

while the new XML schema Toolbox introduced with version 6.0 is a really nice feature, it would be nice to also include elements like key / keyref / unique.
« Last Edit: November 21, 2005, 05:12:54 am by Paule »

cbwhitebu

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Additional eléments for XML schema toolbox
« Reply #1 on: December 15, 2005, 04:33:48 pm »
Quote
Hello,

while the new XML schema Toolbox introduced with version 6.0 is a really nice feature, it would be nice to also include elements like key / keyref / unique.



I agree that this would be a great feature. Right now, if I add an assocation in a class diagram that is modeling an XML schema, then generate the XSD, the association is turned into an attriobute on the referencing type. I need to be able to model some associations as keyrefs to another type instead.

Chris White
Thrasys

SteveHarris

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Additional eléments for XML schema toolbox
« Reply #2 on: February 24, 2006, 03:55:04 am »
Can I add my voice to Key-KeyRef support

This would bring you a long way to full code generation in XML databases.

Steve

SteveHarris

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Additional eléments for XML schema toolbox
« Reply #3 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