From 8da029f2abd7f767e9d0e231ef3e9274e360c5a6 Mon Sep 17 00:00:00 2001
From: ankraft <an.kraft@googlemail.com>
Date: Fri, 26 Apr 2019 13:32:26 +0200
Subject: [PATCH] Added optionality for Arg. Added test case.

---
 SDT/schema4.0/etc/domain.rnc    |  1 +
 SDT/schema4.0/src/domain.rng    |  5 +++++
 SDT/schema4.0/src/domain.xsd    |  1 +
 SDT/schema4.0/test/arg-test.xml | 27 +++++++++++++++++++++++++++
 4 files changed, 34 insertions(+)
 create mode 100644 SDT/schema4.0/test/arg-test.xml

diff --git a/SDT/schema4.0/etc/domain.rnc b/SDT/schema4.0/etc/domain.rnc
index 0f38b2a..f4f495c 100644
--- a/SDT/schema4.0/etc/domain.rnc
+++ b/SDT/schema4.0/etc/domain.rnc
@@ -139,6 +139,7 @@ ArgDef =
   element Args {
     element Arg {
       attribute name { xsd:Name },
+      attribute optional { xsd:boolean }?,
       attribute semanticURI { xsd:anyURI }?,
       DocDef,
       DataTypeDef
diff --git a/SDT/schema4.0/src/domain.rng b/SDT/schema4.0/src/domain.rng
index 756e28a..4f121e9 100644
--- a/SDT/schema4.0/src/domain.rng
+++ b/SDT/schema4.0/src/domain.rng
@@ -386,6 +386,11 @@
 					<attribute name="name">
 						<data type="Name"/>
 					</attribute>
+					<optional>
+						<attribute name="optional">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
 					<optional>
 						<attribute name="semanticURI">
 							<data type="anyURI"/>
diff --git a/SDT/schema4.0/src/domain.xsd b/SDT/schema4.0/src/domain.xsd
index ea7e43d..64c8448 100644
--- a/SDT/schema4.0/src/domain.xsd
+++ b/SDT/schema4.0/src/domain.xsd
@@ -312,6 +312,7 @@
             <xs:element ref="DataType"/>
           </xs:sequence>
           <xs:attribute name="name" use="required" type="xs:Name"/>
+          <xs:attribute name="optional" type="xs:boolean"/>
           <xs:attribute name="semanticURI" type="xs:anyURI"/>
         </xs:extension>
       </xs:complexContent>
diff --git a/SDT/schema4.0/test/arg-test.xml b/SDT/schema4.0/test/arg-test.xml
new file mode 100644
index 0000000..6836bbe
--- /dev/null
+++ b/SDT/schema4.0/test/arg-test.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Test the data types references -->
+
+<Domain id="arg-test" xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+	<ModuleClasses>
+		<ModuleClass name="TestArg">
+			<Actions>
+				<Action name="testAction">
+					<Args>
+						<Arg name="argMandatory">
+							<DataType>
+								<SimpleType type="boolean" />
+							</DataType>
+						</Arg>
+						<Arg name="argOptional" optional="true">
+							<DataType>
+								<SimpleType type="boolean" />
+							</DataType>
+						</Arg>
+					</Args>
+				</Action>
+			</Actions>
+		</ModuleClass>
+	</ModuleClasses>
+
+</Domain>
\ No newline at end of file
-- 
GitLab