You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/08/08 14:25:20 UTC

svn commit: r429635 - in /incubator/tuscany/cpp/sdo/runtime/core: src/commonj/sdo/SDOSchemaSAX2Parser.cpp test/b46617b.xsd

Author: robbinspg
Date: Tue Aug  8 05:25:20 2006
New Revision: 429635

URL: http://svn.apache.org/viewvc?rev=429635&view=rev
Log:
TUSCANY-602 Set isMany correctly for maxOccurs specified on choice/sequence
Fix test case schema

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
    incubator/tuscany/cpp/sdo/runtime/core/test/b46617b.xsd

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp?rev=429635&r1=429634&r2=429635&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Tue Aug  8 05:25:20 2006
@@ -711,13 +711,22 @@
 
             
             setType(thisProperty, attributes, namespaces);
-            
-            SDOXMLString maxOccurs = attributes.getValue("maxOccurs");
-            if (!maxOccurs.isNull())
+
+            // Set isMany. currentType.isMany = true indicates we are in a 
+            // group definition (sequence/choice) with maxOccurs>1
+            if (currentType.isMany)
             {
-                if (!maxOccurs.equalsIgnoreCase("1"))
+                thisProperty.isMany = true;
+            }
+            else
+            {
+                SDOXMLString maxOccurs = attributes.getValue("maxOccurs");
+                if (!maxOccurs.isNull())
                 {
-                    thisProperty.isMany = true;
+                    if (!maxOccurs.equalsIgnoreCase("1"))
+                    {
+                        thisProperty.isMany = true;
+                    }
                 }
             }
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/test/b46617b.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/b46617b.xsd?rev=429635&r1=429634&r2=429635&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/b46617b.xsd (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/b46617b.xsd Tue Aug  8 05:25:20 2006
@@ -17,28 +17,30 @@
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:sdo="commonj.sdo" xmlns:sdoxml="commonj.sdo/xml" 
 xmlns:tns="companyNS" targetNamespace="companyNS">
+
 <xsd:element name="employeeType" type="tns:EmployeeType"/>
 <xsd:complexType name="EmployeeType">
 <xsd:sequence>
-<xsd:element name="name" type="xsd:String" minOccurs="0"/>
 <xsd:element name="SN" type="xsd:String" minOccurs="0"/>
 <xsd:element name="manager" type="xsd:boolean" minOccurs="0"/>
 </xsd:sequence>
+<xsd:attribute name="name" type="xsd:String"/>
 </xsd:complexType>
+
 <xsd:element name="departmentType" type="tns:DepartmentType"/>
 <xsd:complexType name="DepartmentType">
-<xsd:sequence><xsd:element name="name" type="xsd:String" minOccurs="0"/>
+<xsd:sequence>
 <xsd:element name="location" type="xsd:String" minOccurs="0"/>
 <xsd:element name="number" type="xsd:integer" minOccurs="0"/>
 <xsd:element name="employees" type="tns:EmployeeType" minOccurs="0" maxOccurs="unbounded"/>
 </xsd:sequence>
+<xsd:attribute name="name" type="xsd:String"/>
 </xsd:complexType>
+
 <xsd:element name="companyType" type="tns:CompanyType"/>
 <xsd:complexType name="CompanyType" mixed="true">
 <xsd:choice maxOccurs="unbounded">
-<xsd:element name="name" type="xsd:String" minOccurs="0"/>
 <xsd:element name="departments" type="tns:DepartmentType" minOccurs="0" maxOccurs="unbounded"/>
-<xsd:element name="CEO" type="tns:EmployeeType" minOccurs="0"/>
 <xsd:element name="string" type="xsd:String" minOccurs="0"/>
 <xsd:element name="bool" type="xsd:boolean" minOccurs="0"/>
 <xsd:element name="byte" type="xsd:byte" minOccurs="0"/>
@@ -64,7 +66,10 @@
 <xsd:element name="Mshort" type="xsd:short" minOccurs="0" maxOccurs="unbounded"/>
 <xsd:element name="Muri" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
 </xsd:choice>
+
+<xsd:element name="CEO" type="tns:EmployeeType" minOccurs="0"/>
 <xsd:element name="changeSummary" type="sdo:ChangeSummaryType"/>
+<xsd:attribute name="name" type="xsd:String"/>
 <xsd:attribute name="employeeOfTheMonth" sdoxml:propertyType="tns:EmployeeType" type="xsd:IDREF"/>
 </xsd:complexType>
 </xsd:schema> 



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