W3C Widget XML Configuration Schema


<?xml version="1.0" encoding="UTF-8"?>
<!-- Jin Kwon -->
<!-- This XML Schema MAY NOT fully equivalent to W3C's RELAX NG gramma. And it's for internal use only. -->
<xs:schema xmlns="http://www.w3.org/ns/widgets" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/ns/widgets" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://www.w3.org/ns/widgets" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2007/08/xml.xsd"/>
  <!--xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="./xml.xsd"/-->
  <xs:annotation>
    <xs:documentation>Configuration Document</xs:documentation>
  </xs:annotation>
  <xs:element name="widget">
    <xs:annotation>
      <xs:documentation>The root element of a configuration document.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:choice>
          <xs:element name="name">
            <xs:annotation>
              <xs:documentation>The name of the widget.</xs:documentation>
            </xs:annotation>
            <xs:complexType mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="span"/>
                <!--xs:any namespace="##other" processContents="skip"/-->
              </xs:choice>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="short" type="xs:token"/>
              <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
            </xs:complexType>
          </xs:element>
          <xs:element name="description">
            <xs:annotation>
              <xs:documentation>Some text that describes the purpose of the widget.</xs:documentation>
            </xs:annotation>
            <xs:complexType mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="span"/>
                <!--xs:any namespace="##other" processContents="skip"/-->
              </xs:choice>
              <xs:attributeGroup ref="global"/>
              <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
            </xs:complexType>
          </xs:element>
          <xs:element name="author">
            <xs:annotation>
              <xs:documentation>The person or person that created the widget.</xs:documentation>
            </xs:annotation>
            <xs:complexType mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="span"/>
                <!--xs:any namespace="##other" processContents="skip"/-->
              </xs:choice>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="href" type="xs:anyURI"/>
              <xs:attribute name="email" type="xs:token"/>
              <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
            </xs:complexType>
          </xs:element>
          <xs:element name="license">
            <xs:annotation>
              <xs:documentation>The license under which the widget is distributed.</xs:documentation>
            </xs:annotation>
            <xs:complexType mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="span"/>
                <!--xs:any namespace="##other" processContents="skip"/-->
              </xs:choice>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="href" type="xs:anyURI"/>
              <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
            </xs:complexType>
          </xs:element>
          <xs:element name="icon">
            <xs:annotation>
              <xs:documentation>An iconic representation of the widget.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="src" type="xs:token" use="required"/>
              <xs:attribute name="width" type="xs:unsignedInt"/>
              <xs:attribute name="height" type="xs:unsignedInt"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="content">
            <xs:annotation>
              <xs:documentation>The means to point to the "main file" of a widget; serves as a boot-strapping mechanism.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="src" type="xs:token" use="required"/>
              <xs:attribute name="type" type="xs:token"/>
              <xs:attribute name="encoding" type="xs:token" default="UTF-8"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="feature">
            <xs:annotation>
              <xs:documentation>A means to request the availability of a feature, such as an API, that would not normally be part of the default set of features provided by the user agent at runtime.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="param" nillable="true" minOccurs="0" maxOccurs="unbounded">
                  <xs:complexType>
                    <xs:attributeGroup ref="global"/>
                    <xs:attribute name="name" type="xs:token" use="required"/>
                    <xs:attribute name="value" type="xs:token" use="required"/>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="name" type="xs:token" use="required"/>
              <xs:attribute name="required" type="xs:boolean" default="true"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="preference">
            <xs:annotation>
              <xs:documentation>A means to declare a name-value pair that is made available to the widget at runtime.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:attributeGroup ref="global"/>
              <xs:attribute name="name" type="xs:token" use="required"/>
              <xs:attribute name="value" type="xs:token"/>
              <xs:attribute name="readonly" type="xs:boolean" default="false"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="update-description">
            <xs:complexType>
              <xs:attribute name="href" type="xs:anyURI"/>
            </xs:complexType>
          </xs:element>
          <xs:element name="access">
            <xs:complexType>
              <xs:attribute name="origin" type="xs:anyURI" use="required"/>
              <xs:attribute name="subdomains" type="xs:boolean" default="false"/>
              <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:choice>
      <xs:attributeGroup ref="global"/>
      <xs:attribute name="id" type="xs:anyURI"/>
      <xs:attribute name="version" type="xs:token"/>
      <xs:attribute name="height" type="xs:unsignedInt"/>
      <xs:attribute name="width" type="xs:unsignedInt"/>
      <xs:attribute name="viewmodes" type="viewmodes"/>
      <xs:attribute name="defaultlocale" type="xs:language"/>
    </xs:complexType>
    <xs:unique name="uniqueDescriptionByItsLang">
      <xs:selector xpath="tns:description"/>
      <xs:field xpath="@xml:lang"/>
    </xs:unique>
    <xs:unique name="uniqueLicenseByItsLang">
      <xs:selector xpath="tns:license"/>
      <xs:field xpath="@xml:lang"/>
    </xs:unique>
    <xs:unique name="uniqueNameByItsLang">
      <xs:selector xpath="tns:name"/>
      <xs:field xpath="@xml:lang"/>
    </xs:unique>
  </xs:element>
  <xs:simpleType name="dir">
    <xs:restriction base="xs:token">
      <xs:enumeration value="ltr">
        <xs:annotation>
          <xs:documentation>Left-to-right text.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rtl">
        <xs:annotation>
          <xs:documentation>Right-to-left text.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="lro">
        <xs:annotation>
          <xs:documentation>Left-to-right override.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rlo">
        <xs:annotation>
          <xs:documentation>Right-to-left override.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:attributeGroup name="global">
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="dir" type="dir"/>
  </xs:attributeGroup>
  <xs:simpleType name="viewmode">
    <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:simpleType name="viewmodes">
    <xs:list itemType="viewmode"/>
  </xs:simpleType>
  <xs:element name="span">
    <xs:annotation>
      <xs:documentation>A generic text container which is mainly used for internationalization purposes.</xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="span"/>
        <!--xs:any namespace="##other" processContents="skip"/-->
      </xs:choice>
      <xs:attributeGroup ref="global"/>
      <!--xs:anyAttribute namespace="##other" processContents="skip"/-->
    </xs:complexType>
  </xs:element>
</xs:schema>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s