Ensure all XML Files are included in validate and format scripts (#1693)
- Extend zcl.xsd as required
- Clean up malformed XML
diff --git a/zcl-builtin/matter/data-model/draft/types/power-profile.xml b/zcl-builtin/matter/data-model/draft/types/power-profile.xml
index 58f0de6..8c087fa 100644
--- a/zcl-builtin/matter/data-model/draft/types/power-profile.xml
+++ b/zcl-builtin/matter/data-model/draft/types/power-profile.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configurator>
- <enum name="LevelStatus" type="ENUM8">
<enum name="PowerProfileState" type="ENUM8">
<item name="PowerProfileWaitingToStart" value="0x01"/>
<item name="PowerProfileStarted" value="0x02"/>
diff --git a/zcl-builtin/shared/schema/zcl.xsd b/zcl-builtin/shared/schema/zcl.xsd
index 4e56072..4f44213 100644
--- a/zcl-builtin/shared/schema/zcl.xsd
+++ b/zcl-builtin/shared/schema/zcl.xsd
@@ -251,14 +251,21 @@
</xs:restriction>
</xs:simpleType>
</xs:element>
+ <xs:simpleType name="revisionValue">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="1"/>
+ <xs:maxInclusive value="255"/>
+ <xs:whiteSpace value="collapse"/>
+ </xs:restriction>
+ </xs:simpleType>
<xs:element name="revision">
- <xs:simpleType>
- <xs:restriction base="xs:integer">
- <xs:minInclusive value="1"/>
- <xs:maxInclusive value="255"/>
- <xs:whiteSpace value="collapse"/>
- </xs:restriction>
- </xs:simpleType>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="revisionValue">
+ <xs:attribute name="editable" type="xs:boolean" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
<xs:element name="clusters">
<xs:complexType>
@@ -313,6 +320,7 @@
<xs:attribute name="long" type="xs:boolean"/>
<xs:attribute name="analog" type="xs:boolean" use="optional"/>
<xs:attribute name="composite" type="xs:boolean" use="optional"/>
+ <xs:attribute name="baseType" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="bitmap">
@@ -696,6 +704,9 @@
<xs:attribute name="changeOmitted" type="xs:boolean" use="optional"/>
<xs:attribute name="persistence" type="xs:string" use="optional"/>
<xs:attribute name="largeMessage" type="xs:boolean" use="optional"/>
+ <xs:attribute name="nullable" type="xs:boolean" use="optional"/>
+ <xs:attribute name="scene" type="xs:boolean" use="optional"/>
+ <xs:attribute name="reportable" type="xs:boolean" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="conformance" type="xs:string"/>
@@ -789,6 +800,7 @@
<xs:element name="features">
<xs:complexType>
<xs:sequence>
+ <xs:element name="cluster" type="clusterRef" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="feature" maxOccurs="unbounded">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
diff --git a/zcl-builtin/shared/script/format b/zcl-builtin/shared/script/format
index 17445d8..7c92aa8 100755
--- a/zcl-builtin/shared/script/format
+++ b/zcl-builtin/shared/script/format
@@ -10,10 +10,10 @@
xmllint --format --output $A.format --schema ${LOC}/../schema/zcl.xsd $A
mv -f $A.format $A
done
-for A in ${LOC}/../../matter/*.xml; do
- xmllint --format --output $A.format --schema ${LOC}/../schema/zcl.xsd $A
- mv -f $A.format $A
-done
+while IFS= read -r -d '' file; do
+ xmllint --format --output "$file.format" --schema ${LOC}/../schema/zcl.xsd "$file"
+ mv -f "$file.format" "$file"
+done < <(find "${LOC}/../../matter/data-model" -type f -name "*.xml" -print0)
xmllint --format --output ${LOC}/../schema/zcl.xsd.format ${LOC}/../schema/zcl.xsd
mv -f ${LOC}/../schema/zcl.xsd.format ${LOC}/../schema/zcl.xsd
diff --git a/zcl-builtin/shared/script/validate b/zcl-builtin/shared/script/validate
index 2fc879e..15e82ac 100755
--- a/zcl-builtin/shared/script/validate
+++ b/zcl-builtin/shared/script/validate
@@ -15,10 +15,11 @@
SUM=$(( $SUM + $?))
done
-for A in ${LOC}/../../matter/data-model/*.xml; do
- xmllint --noout --schema ${LOC}/../schema/zcl.xsd $A
- SUM=$(( $SUM + $?))
-done
+while IFS= read -r -d '' file; do
+ echo "Validating: $file"
+ xmllint --noout --schema ${LOC}/../schema/zcl.xsd "$file"
+ SUM=$(( SUM + $? ))
+done < <(find "${LOC}/../../matter/data-model" -type f -name "*.xml" -print0)
for A in ${LOC}/../../../test/resource/meta/*.xml; do
xmllint --noout --schema ${LOC}/../schema/zcl.xsd $A