From 220c0acb45fe668bc96ddee10333f2b78242c721 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Mon, 11 May 2020 07:58:42 +0200
Subject: [PATCH] XSD v1_3_0 baseline

---
 CDT-accessControlPolicy.xsd |  26 ++++++--
 CDT-commonTypes.xsd         | 115 ++++++++++++++++++++++++++----------
 CDT-requestPrimitive.xsd    |  10 ++--
 CDT-responsePrimitive.xsd   |   4 +-
 CDT-subscription.xsd        |   4 +-
 5 files changed, 115 insertions(+), 44 deletions(-)

diff --git a/CDT-accessControlPolicy.xsd b/CDT-accessControlPolicy.xsd
index 06b9f18..515ba22 100644
--- a/CDT-accessControlPolicy.xsd
+++ b/CDT-accessControlPolicy.xsd
@@ -97,15 +97,25 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 							<xs:complexType>
 								<xs:sequence>
 									<xs:element name="ipv4Addresses" minOccurs="0" maxOccurs="1">
-										<!-- space separated list of IPv4 addresses -->
+										<!-- space separated list of IPv4 addresses -->										
 										<xs:simpleType>
-											<xs:list itemType="m2m:ipv4" />
+											<xs:restriction>
+												<xs:simpleType>
+													<xs:list itemType="m2m:ipv4" />
+												</xs:simpleType>
+												<xs:minLength value="1"/>
+											</xs:restriction>
 										</xs:simpleType>
 									</xs:element>
 									<xs:element name="ipv6Addresses" minOccurs="0" maxOccurs="1">
 										<!-- space separated list of IPv6 addresses -->
 										<xs:simpleType>
-											<xs:list itemType="m2m:ipv6" />
+											<xs:restriction>
+												<xs:simpleType>
+													<xs:list itemType="m2m:ipv6" />
+												</xs:simpleType>
+												<xs:minLength value="1"/>
+											</xs:restriction>
 										</xs:simpleType>
 									</xs:element>
 								</xs:sequence>
@@ -123,7 +133,12 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:element name="countryCode">
 				<!-- Space separated list of 2-digit country codes -->
 				<xs:simpleType>
-					<xs:list itemType="m2m:countryCode" />
+					<xs:restriction>
+						<xs:simpleType>
+					      <xs:list itemType="m2m:countryCode" />
+						</xs:simpleType>
+						<xs:minLength value="1"/>
+					</xs:restriction>
 				</xs:simpleType>
 			</xs:element>
 			<xs:element name="circRegion">
@@ -134,8 +149,7 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 						<xs:simpleType>
 							<xs:list itemType="xs:float" />
 						</xs:simpleType>
-						<xs:minLength value="3" />
-						<xs:maxLength value="3" />
+						<xs:length value="3" />
 					</xs:restriction>
 				</xs:simpleType>
 			</xs:element>
diff --git a/CDT-commonTypes.xsd b/CDT-commonTypes.xsd
index 1268998..da893a4 100644
--- a/CDT-commonTypes.xsd
+++ b/CDT-commonTypes.xsd
@@ -62,11 +62,21 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 	</xs:simpleType>
 	
 	 <xs:simpleType name="acpType">
-        <list itemType="m2m:ID" />
+	 	<xs:restriction> 
+	 		<xs:simpleType> 
+	 			<xs:list itemType="m2m:ID" /> 
+	 		</xs:simpleType> 	
+	 		<xs:minLength value="1" /> 
+	 	</xs:restriction> 
     </xs:simpleType>
 
 	<xs:simpleType name="labels">
-		<xs:list itemType="xs:token" />
+		<xs:restriction> 
+			<xs:simpleType> 
+				<xs:list itemType="xs:token" />
+			</xs:simpleType> 	
+			<xs:minLength value="1" /> 
+		</xs:restriction> 
 	</xs:simpleType>
 
     <xs:simpleType name="triggerRecipientID">
@@ -78,7 +88,12 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 
 	<!-- "listOfM2MID" is a space separated list of CSE-IDs and/or AE-IDs (i.e. elements of data type m2m:ID") -->
 	<xs:simpleType name="listOfM2MID">
-		<xs:list itemType="m2m:ID" />
+		<xs:restriction> 
+			<xs:simpleType> 
+				<xs:list itemType="m2m:ID" /> 
+			</xs:simpleType> 				
+			<xs:minLength value="1" /> 
+		</xs:restriction> 
 	</xs:simpleType>
 
 	<!-- auxiliary data type required to define "listOflongMin-1" below -->
@@ -88,37 +103,37 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 		</xs:restriction>
 	</xs:simpleType>
 
-	<!-- auxiliary data type required to define "listOfMinMax" below -->
-	<xs:simpleType name="listOflongMin-1">
-		<xs:list itemType="m2m:longMin-1" />
-	</xs:simpleType>
-
 	<!-- "listOfMinMax" represents a list of min and max numbers used in attributes of the [cmdhLimits] resource based on  
 		type xs:long in the range -1, 0, 1, 2 ... . Unit is milliseconds. Value setting of -1 expresses infinity -->
 	<xs:simpleType name="listOfMinMax">
-		<xs:restriction base="m2m:listOflongMin-1">
+		<xs:restriction>
+			<xs:simpleType>
+				<xs:list itemType="m2m:longMin-1" />
+			</xs:simpleType>			
 			<xs:length value="2" />
 		</xs:restriction>
 	</xs:simpleType>
 
-	<!-- auxiliary data type required to define "backOffParameters" below -->
-	<xs:simpleType name="listOfNonNegInt">
-		<xs:list itemType="xs:nonNegativeInteger" />
-	</xs:simpleType>
-
 	<!-- "backOffParameters" is an ordered list of 3 nonNegativeInteger numbers: backoffTime, backoffTimeIncrement, maximumBackoffTime 
 		(in that order!), all units in milliseconds -->
-		
 	<xs:simpleType name="backOffParameters">
-		<xs:restriction base="m2m:listOfNonNegInt">
+		<xs:restriction>
+			<xs:simpleType>
+				<xs:list itemType="xs:nonNegativeInteger" />
+			</xs:simpleType>
 			<xs:length value="3" />
 		</xs:restriction>
 	</xs:simpleType>
 	 
 	<!-- m2m:ipv4 and m2m:ipv6 and m2m:countryCode are defined in the CDT-accessControlPolicy file -->
-	
+
 	<xs:simpleType name="poaList">
-		<xs:list itemType="xs:string" />
+		<xs:restriction> 
+			<xs:simpleType> 
+				<xs:list itemType="xs:string" />
+			</xs:simpleType> 
+			<xs:minLength value="1" /> 
+		</xs:restriction> 
 	</xs:simpleType>
 
     <!--Format is YYYYMMDDThhmmss with no punctuation -->
@@ -127,6 +142,21 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:pattern value="\d{4}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|30|31)T([01]\d|2[0-3])[0-5]\d[0-5]\d"></xs:pattern>
 		</xs:restriction>
 	</xs:simpleType>
+	
+	
+	<xs:simpleType name="absRelTimestamp">
+		<xs:union>
+			<!-- absolute Time -->
+			<xs:simpleType>
+				<xs:restriction base='m2m:timestamp' />
+			</xs:simpleType>
+			<!-- relative Time -->
+			<xs:simpleType>
+				<xs:restriction base='xs:long' />
+			</xs:simpleType>
+		</xs:union>
+	</xs:simpleType>
+	
 
 	<xs:simpleType name="typeOfContent">
         <xs:restriction base="xs:string">
@@ -168,24 +198,39 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
             </simpleType>
         </union>
     </xs:simpleType>
-
+	
     <xs:simpleType name="listOfEventCat">
-        <list itemType="m2m:eventCat" />
+    	<xs:restriction>
+    		<xs:simpleType> 
+    			<xs:list itemType="m2m:eventCat" /> 
+    		</xs:simpleType> 			
+    		<xs:minLength value="1" /> 
+    	</xs:restriction> 
     </xs:simpleType>
 
     <xs:simpleType name="listOfEventCatWithDef">
-        <list itemType="m2m:eventCatWithDef" />
+    	<xs:restriction>
+    		<xs:simpleType> 
+    			<xs:list itemType="m2m:eventCatWithDef" /> 
+    		</xs:simpleType> 	    		
+    		<xs:minLength value="1" /> 
+    	</xs:restriction> 
     </xs:simpleType>
 
 	<xs:simpleType name="scheduleEntry">
 		<xs:restriction base="xs:string">
 			<xs:pattern
-				value="(([*]|[1-5]?\d([,-][1-5]?\d)*)\s+){2}([*]|((1?\d|2[0-3])([,-](1?\d|2[0-3]))*))\s+([*]|(([1-9]|1\d|2\d|3[01])([,-]([1-9]|1\d|2\d|3[01]))*))\s+([*]|(([1-9]|1[0-2])([,-]([1-9]|1[0-2]))*))\s+[*]|([0-6]([,-][0-6])*)" />
+				value="(([*]|[1-5]?\d([,-][1-5]?\d)*)\s+){2}([*]|((1?\d|2[0-3])([,-](1?\d|2[0-3]))*))\s+([*]|(([1-9]|1\d|2\d|3[01])([,-]([1-9]|1\d|2\d|3[01]))*))\s+([*]|(([1-9]|1[0-2])([,-]([1-9]|1[0-2]))*))\s+([*]|([0-6]([,-][0-6])*))" />
 		</xs:restriction>
 	</xs:simpleType>
 
 	<xs:simpleType name="listOfURIs">
-		<list itemType="xs:anyURI" />
+		<xs:restriction> 
+			<xs:simpleType> 
+				<xs:list itemType="xs:anyURI" /> 
+			</xs:simpleType> 
+			<xs:minLength value="1" /> 
+		</xs:restriction> 
 	</xs:simpleType>
 
 
@@ -225,11 +270,11 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:element name="resourceType" type="m2m:resourceType" minOccurs="0" />
 			<xs:element name="name" type="xs:NCName" minOccurs="0" />
 			<xs:element name="originatingTimestamp" type="m2m:timestamp" minOccurs="0" />
-			<xs:element name="requestExpirationTimestamp" type="m2m:timestamp" minOccurs="0" />
-			<xs:element name="resultExpirationTimestamp" type="m2m:timestamp" minOccurs="0" />
-			<xs:element name="operationExecutionTime" type="m2m:timestamp" minOccurs="0" />
+			<xs:element name="requestExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0" />
+			<xs:element name="resultExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0" />
+			<xs:element name="operationExecutionTime" type="m2m:absRelTimestamp" minOccurs="0" />
 			<xs:element name="responseType" type="m2m:responseTypeInfo" minOccurs="0" />
-			<xs:element name="resultPersistence" type="xs:duration" minOccurs="0" />
+			<xs:element name="resultPersistence" type="m2m:absRelTimestamp" minOccurs="0" />
 			<xs:element name="resultContent" type="m2m:resultContent" minOccurs="0" />
 			<xs:element name="eventCategory" type="m2m:eventCat" minOccurs="0" />
 			<xs:element name="deliveryAggregation" type="xs:boolean" minOccurs="0" />
@@ -431,7 +476,7 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:element name="to" type="xs:anyURI" minOccurs="0" />
 			<xs:element name="from" type="m2m:ID" minOccurs="0" />
 			<xs:element name="originatingTimestamp" type="m2m:timestamp" minOccurs="0" />
-			<xs:element name="resultExpirationTimestamp" type="m2m:timestamp" minOccurs="0" />
+			<xs:element name="resultExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0" />
 			<xs:element name="eventCategory" type="m2m:eventCat" minOccurs="0" />
 		</xs:sequence>
 	</xs:complexType>
@@ -472,7 +517,12 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 					<xs:element name="announceTo" type="m2m:listOfURIs" minOccurs="0" />
 					<xs:element name="announcedAttribute" minOccurs="0">
 						<xs:simpleType>
-							<xs:list itemType="xs:NCName" />
+							<xs:restriction> 
+								<xs:simpleType> 
+									<xs:list itemType="xs:NCName" />
+								</xs:simpleType> 	
+								<xs:minLength value="1" /> 
+							</xs:restriction> 
 						</xs:simpleType>
 					</xs:element>
 				</xs:sequence>
@@ -501,7 +551,12 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 					<xs:element name="announceTo" type="m2m:listOfURIs" minOccurs="0" />
 					<xs:element name="announcedAttribute" minOccurs="0">
 						<xs:simpleType>
-							<xs:list itemType="xs:token" />
+							<xs:restriction> 
+								<xs:simpleType> 
+									<xs:list itemType="xs:NCName" />
+								</xs:simpleType>
+								<xs:minLength value="1" /> 
+							</xs:restriction> 
 						</xs:simpleType>
 					</xs:element>
 				</xs:sequence>
diff --git a/CDT-requestPrimitive.xsd b/CDT-requestPrimitive.xsd
index 45a90b0..32a5e88 100644
--- a/CDT-requestPrimitive.xsd
+++ b/CDT-requestPrimitive.xsd
@@ -47,18 +47,20 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
           <xs:element name="name" type="xs:NCName" minOccurs="0"/>
           <!-- parameter "Content" -->
           <xs:element name="primitiveContent" type="m2m:primitiveContent" minOccurs="0"/> 
+          <!-- parameter "Role" -->
+          <xs:element name="role" type="xs:anyType" minOccurs="0"/>           
           <!-- parameter "Originating Timestamp" -->
           <xs:element name="originatingTimestamp" type="m2m:timestamp" minOccurs="0"/>
           <!-- parameter "Request Expiration Timestamp" -->
-          <xs:element name="requestExpirationTimestamp" type="m2m:timestamp" minOccurs="0"/>
+          <xs:element name="requestExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0"/>
           <!-- parameter "Result Expiration Timestamp" -->
-          <xs:element name="resultExpirationTimestamp" type="m2m:timestamp" minOccurs="0"/>
+          <xs:element name="resultExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0"/>
           <!-- parameter "Operation Execution Time" -->
-          <xs:element name="operationExecutionTime" type="m2m:timestamp" minOccurs="0"/>
+          <xs:element name="operationExecutionTime" type="m2m:absRelTimestamp" minOccurs="0"/>
           <!-- parameter "Response Type" -->
           <xs:element name="responseType" type="m2m:responseTypeInfo" minOccurs="0"/>
           <!-- parameter "Result Persistence" -->
-          <xs:element name="resultPersistence" type="xs:duration" minOccurs="0"/>
+          <xs:element name="resultPersistence" type="m2m:absRelTimestamp" minOccurs="0"/>
           <!-- parameter "Result Content" -->
           <xs:element name="resultContent" type="m2m:resultContent" minOccurs="0"/>
           <!-- parameter "Event Category" -->
diff --git a/CDT-responsePrimitive.xsd b/CDT-responsePrimitive.xsd
index 5532412..f8428b5 100644
--- a/CDT-responsePrimitive.xsd
+++ b/CDT-responsePrimitive.xsd
@@ -48,7 +48,7 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
           <!-- parameter "Originating Timestamp" -->
           <xs:element name="originatingTimestamp" type="m2m:timestamp" minOccurs="0"/>
           <!-- parameter "Result Expiration Timestamp" -->
-          <xs:element name="resultExpirationTimestamp" type="m2m:timestamp" minOccurs="0"/>
+          <xs:element name="resultExpirationTimestamp" type="m2m:absRelTimestamp" minOccurs="0"/>
           <!-- parameter "Event Category" -->
           <xs:element name="eventCategory" type="m2m:eventCat" minOccurs="0" />
         </xs:sequence> 	       
@@ -57,7 +57,7 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
   
   <xs:element name="resource" type="m2m:resourceWrapper"  />
   
-  <xs:element name="URIlist" type="m2m:listOfURIs"  />
+  <xs:element name="URIList" type="m2m:listOfURIs"  />
  
   <xs:element name="aggregatedResponse" type="m2m:aggregatedResponse" />
   
diff --git a/CDT-subscription.xsd b/CDT-subscription.xsd
index 87b0cea..44bb0e5 100644
--- a/CDT-subscription.xsd
+++ b/CDT-subscription.xsd
@@ -84,8 +84,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 
 	<xs:complexType name="batchNotify">
 		<xs:sequence>
-			<xs:element name="number" type="xs:nonNegativeInteger" minOccurs="0" />
-			<xs:element name="duration" type="xs:duration" minOccurs="0" />
+			<xs:element name="number" type="xs:nonNegativeInteger" />
+			<xs:element name="duration" type="xs:duration" />
 		</xs:sequence>
 	</xs:complexType>
 	
-- 
GitLab