DEPL 4.0 MAILINGLIST Avatar
  1. OMG Issue

DEPL4 — XML Schema of Deployment spec doesn't honour constraints present in model

  • Key: DEPL4-1
  • Legacy Issue Number: 7354
  • Status: open  
  • Source: Vanderbilt University ( Krishnakumar Balasubramanian)
  • Summary:

    Hi,

    The Deployment & Configuration XML Schema defines a Property element like:

    <xsd:complexType name="Property">
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
    <xsd:element name="name" type="xsd:string" />
    <xsd:element name="value" type="Deployment:Any" />
    <xsd:element ref="xmi:Extension" />
    </xsd:choice>
    <xsd:attribute ref="xmi:id" use="optional" />
    <xsd:attributeGroup ref="xmi:ObjectAttribs" />
    </xsd:complexType>
    <xsd:element name="Property" type="Deployment:Property" />

    This allows for the following invalid Property file to be passed silently
    by the XML Schema validator:

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <Deployment:Property
    xmlns:Deployment="http://www.omg.org/Deployment"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
    <name>ORBSvcConf</name>
    <value>
    <type>
    <kind>tk_string</kind>
    </type>
    <value>
    <string>Foo</string>
    </value>
    </value>
    <value>
    <type>
    <kind>tk_short</kind>
    </type>
    <value>
    <long>123</long>
    </value>
    </value>
    </Deployment:Property>

    The model in 6.10.8 has a containment association with a cardinality one
    for value. The schema generated from that model doesn't match the semantics
    in the model. This is just an example. There are a lot of elements where
    the semantics imposed by the schema are different from what is described in
    the model. I am curious as to why this is allowed. It can be easily fixed
    by changing the schema to:

    <xsd:complexType name="Property">
    <xsd:sequence minOccurs="0" maxOccurs="1">
    <xsd:element name="name" type="xsd:string" />
    <xsd:element name="value" type="Deployment:Any" />
    <xsd:element ref="xmi:Extension" minOccurs="0" />
    </xsd:sequence>
    <xsd:attribute ref="xmi:id" use="optional" />
    <xsd:attributeGroup ref="xmi:ObjectAttribs" />
    </xsd:complexType>
    <xsd:element name="Property" type="Deployment:Property" />

  • Reported: DEPL 1.0b1 — Thu, 13 May 2004 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:58 GMT