Config.xml XML Schema reworked
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 6 May 2013 10:34:01 +0000 (12:34 +0200)
committerGerrit Code Review <gerrit2@kim11>
Tue, 28 May 2013 12:52:51 +0000 (21:52 +0900)
[Issue#]       LINUXWRT-314
[Feature]      Schema reworked base on: dev.w3.org/2006/waf/widgets-schema/
[Cause]        N/A
[Solution]
 1. xsd files were substituted with schema received from convertion
    of http://dev.w3.org/2006/waf/widgets-schema/tests/ relax NG syntax.
 2. Tizen changes were applied as in old config.xsd
 3. Some restrictions have been removed for purpose of tests
[Verification] Validate xml schema: xmlstarlet val -e configuration/widgets.xsd configuration/config.xml
 Check xml schema content.

Change-Id: I960fbd393ce144ab9acf5b67cdafa219ecc435dc

configuration/CMakeLists.txt [new file with mode: 0644]
configuration/access.xsd [new file with mode: 0644]
configuration/common.xsd [new file with mode: 0644]
configuration/config.xsd [deleted file]
configuration/its.xsd [deleted file]
configuration/local.xsd [deleted file]
configuration/packaging-configuration.xsd [new file with mode: 0644]
configuration/updates.xsd [new file with mode: 0644]
configuration/widgets.tizen.xsd [moved from configuration/config.tizen.xsd with 100% similarity]
configuration/widgets.xsd [new file with mode: 0644]
configuration/xml.xsd

diff --git a/configuration/CMakeLists.txt b/configuration/CMakeLists.txt
new file mode 100644 (file)
index 0000000..380f512
--- /dev/null
@@ -0,0 +1,2 @@
+FILE(GLOB XSD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.xsd")
+INSTALL(FILES ${XSD_FILES} DESTINATION /usr/etc/wrt-installer/)
diff --git a/configuration/access.xsd b/configuration/access.xsd
new file mode 100644 (file)
index 0000000..36d2937
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
+  <xs:import schemaLocation="common.xsd"/>
+  <!--
+    Widget Access Request Policy <http://www.w3.org/TR/widgets-access/>
+    requires common.rnc
+  -->
+  <xs:element name="access">
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="foreignAttribute"/>
+      <xs:attribute name="origin" type="xs:string"/>
+      <!-- w3c policy testcases
+      <xs:attribute name="origin" use="required">
+        <xs:simpleType>
+          <xs:union memberTypes="xs:anyURI">
+            <xs:simpleType>
+              <xs:restriction base="xs:string">
+                <xs:enumeration value="*"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:union>
+        </xs:simpleType>
+      </xs:attribute>
+      -->
+      <xs:attribute name="subdomains" type="data.boolean"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/configuration/common.xsd b/configuration/common.xsd
new file mode 100644 (file)
index 0000000..2ce2f7c
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:widgets="http://www.w3.org/ns/widgets">
+  <xs:import namespace="http://www.w3.org/ns/widgets" schemaLocation="widgets.xsd"/>
+
+  <xs:group name="extension">
+    <xs:sequence>
+      <xs:group ref="anyElement"/>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:attributeGroup name="extension">
+    <xs:attributeGroup ref="anyAttribute"/>
+  </xs:attributeGroup>
+
+  <xs:group name="foreignElement">
+    <xs:sequence>
+      <xs:choice minOccurs="0">
+        <xs:group ref="widgets:local"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:attributeGroup name="foreignAttribute">
+    <xs:anyAttribute namespace="##other" processContents="skip"/>
+  </xs:attributeGroup>
+
+  <xs:group name="anyElement">
+    <xs:sequence>
+      <xs:any processContents="skip"/>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:attributeGroup name="anyAttribute">
+    <xs:anyAttribute processContents="skip"/>
+  </xs:attributeGroup>
+
+  <xs:simpleType name="data.positiveNumber">
+    <xs:restriction base="xs:string">
+      <!-- W3C testcase <xs:pattern value="[1-9]\d*"/> -->
+      <xs:pattern value="\s*([1-9]\d*)?.*"/> <!-- accept everything anyway -->
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="data.boolean">
+    <xs:restriction base="xs:string">
+      <!-- w3c testcases - ignore invalid
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      -->
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:attributeGroup name="global.attrs">
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="ltr"/>
+              <xs:enumeration value="rtl"/>
+              <xs:enumeration value="lro"/>
+              <xs:enumeration value="rlo"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name="global.xml">
+    <xs:anyAttribute namespace="##other" processContents="skip"/>
+  </xs:attributeGroup>
+
+  <xs:simpleType name="data.versionNumber">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[0-9]{1,2}.[0-9]{1,2}(.[0-9]{1,4})?"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/configuration/config.xsd b/configuration/config.xsd
deleted file mode 100644 (file)
index 0c83a1e..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- Widgets 1.0 (Working Draft) RELAX NG schema -->\r
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:its="http://www.w3.org/2005/11/its" xmlns:widgets="http://www.w3.org/ns/widgets" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/ns/widgets config.xsd">\r
-    <xs:import schemaLocation="local.xsd"/>\r
-    <xs:import namespace="http://www.w3.org/2005/11/its" schemaLocation="its.xsd"/>\r
-    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>\r
-    <xs:import namespace="http://tizen.org/ns/widgets" schemaLocation="config.tizen.xsd"/>\r
-    <xs:group name="extension">\r
-        <xs:sequence>\r
-            <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:anyElement"/>\r
-        </xs:sequence>\r
-    </xs:group>\r
-    <xs:attributeGroup name="extension">\r
-        <xs:attributeGroup ref="widgets:attr.allowed"/>\r
-    </xs:attributeGroup>\r
-    <xs:group name="anyElement">\r
-        <xs:sequence>\r
-            <xs:choice minOccurs="0" maxOccurs="unbounded">\r
-                <xs:any namespace="##other" processContents="skip"/>\r
-                <xs:any namespace="##local" processContents="skip"/>\r
-            </xs:choice>\r
-        </xs:sequence>\r
-    </xs:group>\r
-    <xs:group name="any">\r
-        <xs:sequence>\r
-            <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:anyElement"/>\r
-        </xs:sequence>\r
-    </xs:group>\r
-    <xs:attributeGroup name="any">\r
-        <xs:anyAttribute processContents="skip"/>\r
-    </xs:attributeGroup>\r
-    <xs:attributeGroup name="attr.allowed">\r
-        <xs:attributeGroup ref="local"/>\r
-    </xs:attributeGroup>\r
-    <xs:attributeGroup name="attr.xmllang">\r
-        <xs:attribute ref="xml:lang" use="required"/>\r
-    </xs:attributeGroup>\r
-    <xs:attributeGroup name="attr.itsdir">\r
-        <xs:attribute ref="its:dir" use="required"/>\r
-    </xs:attributeGroup>\r
-    <xs:simpleType name="data.positiveNumber">\r
-        <xs:restriction base="xs:string">\r
-            <xs:pattern value="[1-9]\d*"/>\r
-        </xs:restriction>\r
-    </xs:simpleType>\r
-    <xs:simpleType name="data.boolean">\r
-        <xs:restriction base="xs:string">\r
-            <xs:enumeration value="true"/>\r
-            <xs:enumeration value="false"/>\r
-        </xs:restriction>\r
-    </xs:simpleType>\r
-    <xs:simpleType name="data.versionNumber">\r
-        <xs:restriction base="xs:string">\r
-            <xs:pattern value="[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,4}"/>\r
-        </xs:restriction>\r
-    </xs:simpleType>\r
-    <xs:element name="widget">\r
-        <xs:complexType mixed="true">\r
-            <xs:choice minOccurs="0" maxOccurs="unbounded">\r
-                <xs:element ref="widgets:name"/>\r
-                <xs:element ref="widgets:description"/>\r
-                <xs:element ref="widgets:icon"/>\r
-                <xs:element ref="widgets:author"/>\r
-                <xs:element ref="widgets:license"/>\r
-                <xs:element ref="widgets:content"/>\r
-                <xs:element ref="widgets:feature"/>\r
-                <xs:element ref="widgets:preference"/>\r
-                <xs:element ref="widgets:access"/>\r
-                <!-- "widgets:extension" group is commented. Otherwise, error: cos-nonambig: Content model violates the unique particle attribution rule. -->\r
-                <!-- Allowing Any Elements or Attributes from a Particular Namespace -->\r
-                <!-- The wildcards permitted within the list are ##local (a nonqualified element) and ##targetNamespace (the target namespace). Two wildcards can also be used instead of the list: ##any (any namespace) and ##other (any namespace other than the target namespace). -->\r
-                <!--xs:group ref="widgets:extension"/-->\r
-                <xs:element ref="tizen:app-control"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:setting"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:application" minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:content"  minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:privilege"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:content-security-policy" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:content-security-policy-report-only" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:allow-navigation" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:app-widget"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:account"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-                <xs:element ref="tizen:metadata"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
-            </xs:choice>\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute name="id" type="xs:anyURI"/>\r
-            <xs:attribute name="version" type="widgets:data.versionNumber"/>\r
-            <xs:attribute name="height" type="widgets:data.positiveNumber"/>\r
-            <xs:attribute name="width" type="widgets:data.positiveNumber"/>\r
-            <xs:attribute name="viewmodes">\r
-                <xs:simpleType>\r
-                    <xs:list>\r
-                        <xs:simpleType>\r
-                            <xs:restriction base="xs:token">\r
-                                <xs:enumeration value="maximized"/>\r
-                                <xs:enumeration value="fullscreen"/>\r
-                            </xs:restriction>\r
-                        </xs:simpleType>\r
-                    </xs:list>\r
-                </xs:simpleType>\r
-            </xs:attribute>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="name">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute ref="its:dir"/>\r
-            <xs:attribute name="short"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="description">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute ref="its:dir"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="icon">\r
-        <xs:complexType>\r
-            <xs:attributeGroup ref="widgets:attr.allowed"/>\r
-            <xs:attribute name="src" use="required" type="xs:anyURI"/>\r
-            <xs:attribute name="height" type="widgets:data.positiveNumber"/>\r
-            <xs:attribute name="width" type="widgets:data.positiveNumber"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="access">\r
-        <xs:complexType>\r
-            <xs:attributeGroup ref="widgets:attr.allowed"/>\r
-            <xs:attribute name="origin" use="required" type="xs:anyURI"/>\r
-            <xs:attribute name="subdomains" use="optional" type="widgets:data.boolean"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="author">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute ref="its:dir"/>\r
-            <xs:attribute name="href" type="xs:anyURI"/>\r
-            <xs:attribute name="email">\r
-                <xs:simpleType>\r
-                    <xs:restriction base="xs:string">\r
-                    </xs:restriction>\r
-                </xs:simpleType>\r
-            </xs:attribute>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="license">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute ref="its:dir"/>\r
-            <xs:attribute name="href" type="xs:anyURI"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="content">\r
-        <xs:complexType>\r
-            <xs:attributeGroup ref="widgets:attr.allowed"/>\r
-            <xs:attribute name="src" use="required" type="xs:anyURI"/>\r
-            <xs:attribute name="type"/>\r
-            <xs:attribute name="charset"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="feature">\r
-        <xs:complexType mixed="true">\r
-            <xs:choice minOccurs="0" maxOccurs="unbounded">\r
-                <xs:element ref="widgets:param"/>\r
-            </xs:choice>\r
-            <xs:attribute name="name" use="required" type="xs:anyURI"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="param">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute name="name" use="required"/>\r
-            <xs:attribute name="value" use="required"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="preference">\r
-        <xs:complexType mixed="true">\r
-            <xs:attribute ref="xml:lang"/>\r
-            <xs:attribute name="name" use="required"/>\r
-            <xs:attribute name="value"/>\r
-            <xs:attribute name="readonly" type="widgets:data.boolean"/>\r
-            <xs:attributeGroup ref="widgets:extension"/>\r
-        </xs:complexType>\r
-    </xs:element>\r
-</xs:schema>\r
diff --git a/configuration/its.xsd b/configuration/its.xsd
deleted file mode 100644 (file)
index 49a2acd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2005/11/its" xmlns:widgets="http://www.w3.org/ns/widgets" xmlns:its="http://www.w3.org/2005/11/its">
-  <xs:import schemaLocation="local.xsd"/>
-  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
-  <xs:attribute name="dir">
-    <xs:simpleType>
-      <xs:restriction base="xs:token">
-        <xs:enumeration value="ltr"/>
-        <xs:enumeration value="rtl"/>
-        <xs:enumeration value="lro"/>
-        <xs:enumeration value="rlo"/>
-      </xs:restriction>
-    </xs:simpleType>
-  </xs:attribute>
-</xs:schema>
diff --git a/configuration/local.xsd b/configuration/local.xsd
deleted file mode 100644 (file)
index 59a9833..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:widgets="http://www.w3.org/ns/widgets" xmlns:its="http://www.w3.org/2005/11/its">
-  <xs:import namespace="http://www.w3.org/2005/11/its" schemaLocation="its.xsd"/>
-  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
-  <xs:attributeGroup name="local">
-    <xs:anyAttribute namespace="##other" processContents="skip"/>
-  </xs:attributeGroup>
-</xs:schema>
diff --git a/configuration/packaging-configuration.xsd b/configuration/packaging-configuration.xsd
new file mode 100644 (file)
index 0000000..bb130eb
--- /dev/null
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
+  <xs:import schemaLocation="common.xsd"/>
+  <xs:import namespace="http://tizen.org/ns/widgets" schemaLocation="widgets.tizen.xsd"/>
+  <!--
+    Widget Packaging and Configuration <http://www.w3.org/TR/widgets/>
+    requires common.rnc
+  -->
+  <xs:element name="widget">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="widgets:group.widgetContent">
+          <xs:attributeGroup ref="global.attrs"/>
+          <xs:attributeGroup ref="global.xml"/>
+          <xs:attributeGroup ref="extension"/>
+          <xs:attribute name="id" type="xs:anyURI"/>
+          <xs:attribute name="defaultlocale"/>
+          <xs:attribute name="version"/>
+          <xs:attribute name="min-version" type="data.versionNumber"/>
+          <xs:attribute name="height" type="data.positiveNumber"/>
+          <xs:attribute name="width" type="data.positiveNumber"/>
+          <xs:attribute name="viewmodes">
+            <xs:simpleType>
+              <xs:list>
+                <xs:simpleType>
+                  <xs:restriction base="xs:token">
+                    <xs:enumeration value="windowed"/>
+                    <xs:enumeration value="floating"/>
+                    <xs:enumeration value="fullscreen"/>
+                    <xs:enumeration value="maximized"/>
+                    <xs:enumeration value="minimized"/>
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:list>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="group.widgetContent" mixed="true">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:choice>
+        <xs:element ref="widgets:name"/>
+        <xs:element ref="widgets:description"/>
+        <xs:element ref="widgets:icon"/>
+        <xs:element ref="widgets:author"/>
+        <xs:element ref="widgets:license"/>
+        <xs:element ref="widgets:content"/>
+        <xs:element ref="widgets:feature"/>
+        <xs:element ref="widgets:preference"/>
+
+        <xs:element ref="tizen:app-control"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:setting"  maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:application" minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:content"  minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:privilege"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:content-security-policy" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:content-security-policy-report-only" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:allow-navigation" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:app-widget"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:account"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:element ref="tizen:metadata"  minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
+        <xs:group ref="foreignElement"/>
+        <!-- W3C testcases fail - should accept any element -->
+      </xs:choice>
+      <xs:element ref="widgets:access"/>
+      <xs:element ref="widgets:update-description"/>
+    </xs:choice>
+  </xs:complexType>
+  <xs:element name="name">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:span"/>
+        <xs:group ref="foreignElement"/>
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <xs:attribute name="short"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="description">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:span"/>
+        <xs:group ref="foreignElement"/>
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="icon">
+    <xs:complexType>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="foreignAttribute"/>
+      <!-- w3c testcase - must ignore
+      <xs:attribute name="src" use="required" type="xs:anyURI"/>
+      -->
+      <xs:attribute name="src" type="xs:anyURI"/>
+      <xs:attribute name="height" type="data.positiveNumber"/>
+      <xs:attribute name="width" type="data.positiveNumber"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="author">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:span"/>
+        <xs:group ref="foreignElement"/>
+        <!-- W3C testcases fail - should accept any element -->
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <xs:attribute name="href" type="xs:anyURI"/>
+      <xs:attribute name="email" type="xs:string"/>
+      <!-- fails W3C testcases
+      <xs:attribute name="email">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:pattern value=".+@.+"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+       -->
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="license">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:span"/>
+        <xs:group ref="foreignElement"/>
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <xs:attribute name="href" type="xs:anyURI"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="content">
+    <xs:complexType>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="foreignAttribute"/>
+      <!-- w3c testcase - ignore not valid
+      <xs:attribute name="src" use="required" type="xs:anyURI"/>
+      -->
+      <xs:attribute name="src" type="xs:string"/>
+      <xs:attribute name="type"/>
+      <xs:attribute name="encoding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="feature">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:param"/>
+        <xs:group ref="foreignElement"/>
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <!-- w3c tescase - must ignore
+      <xs:attribute name="name" use="required" type="xs:anyURI"/>
+      -->
+      <xs:attribute name="name" type="xs:anyURI"/>
+      <xs:attribute name="required" type="data.boolean"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="param">
+    <xs:complexType mixed="true">
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="value"/>
+      <!-- w3c testcase - must ignore
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="value" use="required"/>
+      -->
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="span">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="widgets:span"/>
+        <xs:group ref="foreignElement"/>
+      </xs:choice>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="preference">
+    <xs:complexType mixed="true">
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
+      <xs:attributeGroup ref="global.attrs"/>
+      <xs:attributeGroup ref="global.xml"/>
+      <xs:attributeGroup ref="extension"/>
+      <!-- w3c testcase -required but missing
+      <xs:attribute name="name" use="required"/>
+      -->
+      <xs:attribute name="name"/>
+      <xs:attribute name="value"/>
+      <xs:attribute name="readonly" type="data.boolean"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/configuration/updates.xsd b/configuration/updates.xsd
new file mode 100644 (file)
index 0000000..6be386b
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
+    <xs:import schemaLocation="common.xsd"/>
+    <!--
+    Widget Updates <http://www.w3.org/TR/widgets-updates/>
+    requires common.rnc
+    -->
+    <xs:element name="update-description">
+    <xs:complexType mixed="true">
+        <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
+        <xs:attributeGroup ref="foreignAttribute"/>
+        <xs:attribute name="href" use="required" type="xs:anyURI"/>
+    </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/configuration/widgets.xsd b/configuration/widgets.xsd
new file mode 100644 (file)
index 0000000..839fa03
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  RELAX NG Schema for the Widgets Family of Specifications
+  
+  This document is non-normative.
+  
+  The following is a RELAX NG schema representation of the elements,
+  and attributes, that can be used in a widget's configuration document.
+  
+  A conformance checker may use the RELAX NG for the configuration document to validate
+  elements and attributes of a configuration document within the limits of the RELAX NG
+  specification.
+  
+  Authors: David H�s�ther, Marcos C�ceres, Robin Berjon
+  Contact: public-webapps@w3.org if you find any errors or have any questions
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
+    <xs:include schemaLocation="packaging-configuration.xsd"/>
+    <xs:include schemaLocation="access.xsd"/>
+    <xs:include schemaLocation="updates.xsd"/>
+    <xs:import schemaLocation="common.xsd"/>
+    <xs:group name="local">
+        <xs:sequence>
+            <xs:any namespace="##other" processContents="skip"/>
+        </xs:sequence>
+    </xs:group>
+</xs:schema>
index d9ed2aa..715330a 100644 (file)
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:widgets="http://www.w3.org/ns/widgets" xmlns:its="http://www.w3.org/2005/11/its"  targetNamespace="http://www.w3.org/XML/1998/namespace" elementFormDefault="qualified">
-    <xs:import schemaLocation="local.xsd"/>
-    <xs:import namespace="http://www.w3.org/2005/11/its" schemaLocation="its.xsd"/>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:widgets="http://www.w3.org/ns/widgets" xmlns:its="http://www.w3.org/2005/11/its"  targetNamespace="http://www.w3.org/XML/1998/namespace" elementFormDefault="qualified">
     <xs:attribute name="lang" type="xs:language"/>
 </xs:schema>