XMI 2.1 NO IDEA Avatar
  1. OMG Issue

XMI21 — XMI 2.0 issue: Proxies and Multiplicities

  • Key: XMI21-12
  • Legacy Issue Number: 5950
  • Status: open  
  • Source: Zuehlke Engineering ( Frank Pilhofer)
  • Summary:

    Doc references are based on formal/03-05-02.

    In a Schema that is produced by the XML Schema Production
    rules, enforcement of multiplicities is incompatible with
    the use of proxies.

    According to 1.10.1, page 1-21, "Elements act as a union,
    where they are either a definition or a proxy. Proxies use
    the LinkAttribs attribute group to define the link, and
    contain no nested elements."

    However, if the org.omg.xmi.enforceMinimumMultiplicity is
    true, then the generated schema does not allow the complex-
    Type's content to be empty, and so proxies cannot exist in
    an XML document.

    As a simple fix, the 4b:ClassContents could be wrapped into
    an additional choice element, as in

    <xsd:choice minOccurs="0">
    <xsd:sequence>
    4b:ClassContents
    </xsd:sequence>
    </xsd:choice>

    This would allow the element to be empty. However, in this
    form, an XML document that contained both link attributes
    and contents would still validate.

    A stronger solution would be to make a choice between a
    link element and contents, by removing the LinkAttribs from
    the ObjectAttribs attribute group and by, in rule set 4,
    defining something along the lines of

    <xsd:choice>
    <xsd:sequence>
    4b:ClassContents
    </xsd:sequence>
    <xsd:element name="href" type="xsd:string">
    <xsd:element name="idref" type="IDREF">
    </xsd:choice>

    This way, an element in a validating document could only be
    either a proxy or not.

    As a side note to this issue, there are obviously unpleasant
    side effects when org.omg.xmi.enforceMinimumMultiplicity is
    true and org.omg.xmi.element is false. org.omg.xmi.enforce-
    MinimumMultiplicity=true should have the same effect as
    if org.omg.xmi.element=true and org.omg.xmi.attribute=false.

  • Reported: XMI 1.3 — Thu, 12 Jun 2003 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:59 GMT