]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
added schema files for validation
authorMichael Wiebusch <stratomaster@gmx.net>
Mon, 8 Jul 2013 08:45:01 +0000 (10:45 +0200)
committerMichael Wiebusch <stratomaster@gmx.net>
Mon, 8 Jul 2013 08:45:01 +0000 (10:45 +0200)
schema/JTAG_SPEC.xsd [new file with mode: 0644]
schema/configFile.xsd [new file with mode: 0644]

diff --git a/schema/JTAG_SPEC.xsd b/schema/JTAG_SPEC.xsd
new file mode 100644 (file)
index 0000000..98701cb
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  
+  
+  <xs:simpleType name="nametype">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[0-9a-zA-Z_]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="valuetype">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="(0[xX][0-9a-fA-F]+)|([0-9]+)|(0[bB][01]+)"/> 
+      <!-- allowed is decimal, hex with prefix 0x and binary with prefix 0b -->
+    </xs:restriction>
+  </xs:simpleType>
+  
+  
+  <xs:element name="MAPS">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="register" maxOccurs="unbounded">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="description" type="xs:string"/>
+              <xs:element name="field" maxOccurs="unbounded">
+                <xs:complexType>
+                  <xs:all>
+                    <xs:element name="description" type="xs:string"/>
+                  </xs:all>
+                  <xs:attribute name="name" type="nametype"/>
+                  <xs:attribute name="start" type="xs:nonNegativeInteger"/>
+                  <xs:attribute name="end" type="xs:nonNegativeInteger"/>
+                  <xs:attribute name="size" type="xs:positiveInteger"/>
+                  <xs:attribute name="defaultValue" type="valuetype"/>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>    
+            <xs:attribute name="name" type="nametype"/>
+            <xs:attribute name="id" type="xs:string"/>
+            <xs:attribute name="size" type="xs:positiveInteger"/>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+      <xs:attribute name="type" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/schema/configFile.xsd b/schema/configFile.xsd
new file mode 100644 (file)
index 0000000..90b1c23
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  
+  
+  <xs:simpleType name="nametype">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[0-9a-zA-Z_]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="valuetype">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="(0[xX][0-9a-fA-F]+)|([0-9]+)|(0[bB][01]+)"/> 
+      <!-- allowed is decimal, hex with prefix 0x and binary with prefix 0b -->
+    </xs:restriction>
+  </xs:simpleType>
+  
+  
+  <xs:element name="MAPS">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="register" maxOccurs="unbounded" minOccurs="0">
+          <xs:complexType>
+            <xs:sequence>
+
+              <xs:element name="field" maxOccurs="unbounded">
+                <xs:complexType>
+                  <xs:attribute name="name" type="nametype"/>
+                  <xs:attribute name="value" type="valuetype"/>
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>    
+            <xs:attribute name="name" type="nametype"/>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+      <xs:attribute name="type" type="xs:string"/>
+      <xs:attribute name="specDbFile" type="xs:string"/>
+      <xs:attribute name="inheritSettingsFrom" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file