root/juggler/branches/2.2/modules/jackal/data/definition.xsd

Revision 16284, 5.4 kB (checked in by patrickh, 4 years ago)

New feature: Config definition versions can now be marked as "abstract"

to indicate to editor tools that that definition version
cannot be instantiated as a config element. This will
help prevent invalid configurations from being created by
users who try to create config elements of element base
types.

While this change does introduce a new child of the XML element
<definition_version>, I have implemented this in a way that is backwards
compatible with versions 3.0 and 3.1 of the config definition file format.
Hence, there is no need to increment the file format version, but the XML
schema definition.xsd will have to be updated on the VR Juggler website.

This includes an API change to org.vrjuggler.jccl.config.ConfigDefinition?
and to org.vrjuggler.jccl.config.event.ConfigDefinitionListener?. Bumped
version to 0.24.0 to mark this change.

Approved by: aronb

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE schema SYSTEM "http://www.w3.org/1999/XMLSchema.dtd">
3
4 <!-- JCCL definition schema for definition file format v3.1 -->
5 <!-- $Id$ -->
6
7 <xs:schema targetNamespace="http://www.vrjuggler.org/jccl/xsd/3.1/definition"
8            elementFormDefault="qualified"
9            attributeFormDefault="unqualified"
10            xmlns:xs="http://www.w3.org/2001/XMLSchema"
11            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12            xmlns="http://www.vrjuggler.org/jccl/xsd/3.1/definition">
13
14    <!--
15       The following import will be needed when the XSLT schema is written. Until
16       then, we don't need it.
17
18       <xs:import namespace="http://www.w3.org/1999/XSL/Transform" />
19    -->
20
21    <xs:element name="definition">
22       <xs:complexType>
23          <xs:sequence>
24             <xs:element name="definition_version" type="definition_version" minOccurs="1" maxOccurs="unbounded" />
25          </xs:sequence>
26          <!-- The name must be a valid XML name token. -->
27          <xs:attribute name="name" type="xs:NCName" use="required" />
28          <xs:attribute name="icon_path" type="xs:token" />
29       </xs:complexType>
30    </xs:element>
31
32    <!-- The type for an individual version of a definition. -->
33    <xs:complexType name="definition_version">
34       <xs:sequence>
35          <xs:element name="abstract" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false" />
36          <xs:element name="help" type="xs:token" />
37          <xs:element name="parent" type="parent" minOccurs="0" maxOccurs="unbounded" />
38          <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
39          <xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
40          <xs:element name="upgrade_transform" type="upgrade_transform" />
41       </xs:sequence>
42       <xs:attribute name="version" type="xs:positiveInteger" use="required" />
43       <xs:attribute name="label" type="xs:token" use="required" />
44    </xs:complexType>
45
46    <!--
47       The type for a parent element. It is defined as being an XML token or
48       empty for the situation where the element does not have a parent.
49    -->
50    <xs:simpleType name="parent">
51       <xs:union>
52          <xs:simpleType>
53             <xs:restriction base="xs:NCName" />
54          </xs:simpleType>
55          <xs:simpleType>
56             <xs:restriction base="xs:string">
57                <xs:enumeration value="" />
58             </xs:restriction>
59          </xs:simpleType>
60       </xs:union>
61    </xs:simpleType>
62
63    <!--
64       The property type. This type could use some work so that it's really a
65       choice between the different ways a property can be formed. For example,
66       a property whose valuetype is "configelement" should be required to
67       have at least one allowed_type child.
68    -->
69    <xs:complexType name="property">
70       <xs:sequence>
71          <xs:element name="help" type="xs:token" />
72          <xs:element name="value" type="value" minOccurs="1" maxOccurs="unbounded" />
73          <xs:element name="allowed_type" type="xs:NCName" minOccurs="0" maxOccurs="unbounded" />
74          <xs:element name="enumeration" type="enumeration" minOccurs="0" maxOccurs="1" />
75       </xs:sequence>
76       <xs:attribute name="valuetype" type="valuetype" use="required" />
77       <xs:attribute name="variable" type="xs:boolean" use="required" />
78       <xs:attribute name="name" type="xs:NCName" use="required" />
79    </xs:complexType>
80
81    <!-- The valuetype type. -->
82    <xs:simpleType name="valuetype">
83       <xs:restriction base="xs:string">
84          <xs:enumeration value="boolean" />
85          <xs:enumeration value="configelement" />
86          <xs:enumeration value="configelementpointer" />
87          <xs:enumeration value="float" />
88          <xs:enumeration value="integer" />
89          <xs:enumeration value="string" />
90       </xs:restriction>
91    </xs:simpleType>
92
93    <!--
94       The value element. This needs to be worked on so that the default value
95       is constrained to the type that the property is defining.
96    -->
97    <xs:complexType name="value">
98       <xs:attribute name="label" type="xs:token" use="required" />
99       <xs:attribute name="defaultvalue" type="xs:anySimpleType" use="optional" />
100    </xs:complexType>
101
102    <!--
103       The enumeration element.
104    -->
105    <xs:complexType name="enumeration">
106       <xs:sequence>
107          <xs:element name="enum" type="enum" minOccurs="0" maxOccurs="unbounded" />
108       </xs:sequence>
109       <xs:attribute name="editable" type="xs:boolean" use="optional" default="false" />
110    </xs:complexType>
111
112    <!--
113       The enum element. This needs to be worked on so that the value is
114       constrained to the type that the property is defining.
115    -->
116    <xs:complexType name="enum">
117       <xs:attribute name="label" type="xs:token" use="required" />
118       <xs:attribute name="value" type="xs:anySimpleType" use="required" />
119    </xs:complexType>
120
121    <!--
122       The upgrade_transform element simple contains an XSLT.
123    -->
124    <xs:complexType name="upgrade_transform">
125       <xs:sequence>
126          <!--
127             A schema for XSLT does not yet exist, so just accept any element in
128             the schema namespace until it is written.
129             <xs:element ref="xsl:stylesheet" />
130          -->
131          <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
132                  minOccurs="0"
133                  maxOccurs="1"
134                  processContents="lax" />
135       </xs:sequence>
136    </xs:complexType>
137
138 </xs:schema>
Note: See TracBrowser for help on using the browser.