You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Brian Murray <br...@gmail.com> on 2007/03/23 20:03:08 UTC

SDO: Agree on XSD for CTS?

I'd like to get some agreement on/review of the XSD we're using for the
CTS.  There have been a few instances where we thought there was a problem
only to find that the CTS was invalid/incorrect in some way.  (Or was
unnecessarily complicated.)

Below is the XSD I'm proposing.  Please let me know if you'd like to see any
changes.  (Please do give some thought to additions you'd like to see.  Are
there areas that you think could not be hit given this XSD?)

Note that this is slightly different than the XSD currently in the CTS and
will require some updating of the CTS test cases.  (For example, the test
for the presence of a baseType is currently done on the same Type for which
many Sequence tests are done.  You can see in the XSD below that these have
been separated.)   I will make the corresponding changes when I introduce
the XSD changes.

Thank you,

Brian
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
 *  Copyright (c) 2005-2006 The Apache Software Foundation or its licensors,
as applicable.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 -->
<xsd:schema xmlns:sdo="commonj.sdo" xmlns:api="
http://www.example.com/api_test" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/api_test">
    <xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>

     <xsd:element name="apiTestElem" type="api:APITest"/>

     <xsd:complexType mixed="false" name="APITest">
       <xsd:sequence>
          <xsd:element name="stringVal" type="xsd:string"/>
          <xsd:element name="booleanVal" type="xsd:boolean"/>
          <xsd:element name="booleanVal2" type="xsd:boolean"/>
          <xsd:element name="byteVal" type="xsd:byte"/>
          <xsd:element name="stringVal2" type="xsd:string"/>
          <xsd:element name="decimalVal" type="xsd:decimal"/>
          <xsd:element name="decimalVal2" sdo:aliasName="dec2"
type="xsd:decimal"/>
          <xsd:element name="intVal" type="xsd:int"/>
          <xsd:element name="floatVal" type="xsd:float"/>
          <xsd:element name="doubleVal" type="xsd:double"/>
          <xsd:element name="dateVal" type="xsd:dateTime"/>
          <xsd:element name="shortVal" type="xsd:short"/>
          <xsd:element name="longVal" type="xsd:long"/>
          <xsd:element maxOccurs="unbounded" minOccurs="0" name="children"
type="api:APITest"/>
          <xsd:element name="bytesVal" type="xsd:hexBinary"/>
          <xsd:element name="integerVal" type="xsd:integer"/>
          <xsd:element name="charVal" type="api:char"/>
          <xsd:element name="sequencedElem" type="api:Sequenced"/>
          <xsd:element name="extendedElem" type="api:Extended"/>
       </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="Sequenced" mixed="true">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="Numbers"
type="xsd:int"/>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="Letters"
type="xsd:string"/>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:simpleType name="char">
      <xsd:restriction base="xsd:string">
         <xsd:length value="1"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:complexType abstract="true" name="Abstract">
     <xsd:sequence>
       <xsd:element name="firstName" type="xsd:string"/>
       <xsd:element name="lastName" type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="Extended" sdo:aliasName="Ext2">
     <xsd:complexContent>
       <xsd:extension base="api:Abstract">
         <xsd:sequence>
            <xsd:element name="nickName" type="xsd:string"/>
            <xsd:element name="middleName" type="xsd:string"/>
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

</xsd:schema>

Re: SDO: Agree on XSD for CTS?

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Looks like a good start to me. The mixed="false" attribute isn't needed 
since it's the default.

Frank.




"Brian Murray" <br...@gmail.com> 
03/23/2007 03:03 PM
Please respond to
tuscany-dev@ws.apache.org


To
tuscany-dev@ws.apache.org
cc

Subject
SDO: Agree on XSD for CTS?






I'd like to get some agreement on/review of the XSD we're using for the
CTS.  There have been a few instances where we thought there was a problem
only to find that the CTS was invalid/incorrect in some way.  (Or was
unnecessarily complicated.)

Below is the XSD I'm proposing.  Please let me know if you'd like to see 
any
changes.  (Please do give some thought to additions you'd like to see. Are
there areas that you think could not be hit given this XSD?)

Note that this is slightly different than the XSD currently in the CTS and
will require some updating of the CTS test cases.  (For example, the test
for the presence of a baseType is currently done on the same Type for 
which
many Sequence tests are done.  You can see in the XSD below that these 
have
been separated.)   I will make the corresponding changes when I introduce
the XSD changes.

Thank you,

Brian
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
 *  Copyright (c) 2005-2006 The Apache Software Foundation or its 
licensors,
as applicable.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 -->
<xsd:schema xmlns:sdo="commonj.sdo" xmlns:api="
http://www.example.com/api_test" xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/api_test">
    <xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>

     <xsd:element name="apiTestElem" type="api:APITest"/>

     <xsd:complexType mixed="false" name="APITest">
       <xsd:sequence>
          <xsd:element name="stringVal" type="xsd:string"/>
          <xsd:element name="booleanVal" type="xsd:boolean"/>
          <xsd:element name="booleanVal2" type="xsd:boolean"/>
          <xsd:element name="byteVal" type="xsd:byte"/>
          <xsd:element name="stringVal2" type="xsd:string"/>
          <xsd:element name="decimalVal" type="xsd:decimal"/>
          <xsd:element name="decimalVal2" sdo:aliasName="dec2"
type="xsd:decimal"/>
          <xsd:element name="intVal" type="xsd:int"/>
          <xsd:element name="floatVal" type="xsd:float"/>
          <xsd:element name="doubleVal" type="xsd:double"/>
          <xsd:element name="dateVal" type="xsd:dateTime"/>
          <xsd:element name="shortVal" type="xsd:short"/>
          <xsd:element name="longVal" type="xsd:long"/>
          <xsd:element maxOccurs="unbounded" minOccurs="0" name="children"
type="api:APITest"/>
          <xsd:element name="bytesVal" type="xsd:hexBinary"/>
          <xsd:element name="integerVal" type="xsd:integer"/>
          <xsd:element name="charVal" type="api:char"/>
          <xsd:element name="sequencedElem" type="api:Sequenced"/>
          <xsd:element name="extendedElem" type="api:Extended"/>
       </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="Sequenced" mixed="true">
      <xsd:sequence>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="Numbers"
type="xsd:int"/>
         <xsd:element maxOccurs="unbounded" minOccurs="0" name="Letters"
type="xsd:string"/>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:simpleType name="char">
      <xsd:restriction base="xsd:string">
         <xsd:length value="1"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:complexType abstract="true" name="Abstract">
     <xsd:sequence>
       <xsd:element name="firstName" type="xsd:string"/>
       <xsd:element name="lastName" type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="Extended" sdo:aliasName="Ext2">
     <xsd:complexContent>
       <xsd:extension base="api:Abstract">
         <xsd:sequence>
            <xsd:element name="nickName" type="xsd:string"/>
            <xsd:element name="middleName" type="xsd:string"/>
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

</xsd:schema>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org