1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
|
<?xml version='1.0' encoding='UTF-8'?> <!-- -*- mode: nxml; -*- -->
<!--
Copyright (c) 2010 by Gabriel M. Beddingfield <gabriel@teuton.org>
This file is part of Tritium
Tritium is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Tritium is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY, without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://gabe.is-a-geek.org/tritium/xml/1/'
xmlns:T='http://gabe.is-a-geek.org/tritium/xml/1/'
elementFormDefault='qualified' >
<!-- Version 1.0
Version Policy: The version of this schema has no relationship
to the version of Composite or libTritium. It will be in the
format MAJOR.MINOR.
When comparing versions or documents:
* If the MAJOR versions DO NOT match, then the schemas are not
at all compatable. Note that the MAJOR version shall match
the last component of the namespace URI.
* If the MAJOR versions DO match, then the schemas are
compatable as explained below for MINOR version numbers.
* MINOR versions: Suppose you have schemas 1.A and 1.B where
A < B. All documents that validate with 1.B shall also
validate under 1.A. All documents that validate under 1.A
shall validate under 1.B. If an application only supports
1.A it shall still load 1.B without error, however any new
components will be ignored.
Note that there is liberal use of <xs:any> and <xs:anyAttribute>
in this Schema in order to aid forward-compatibility.
-->
<xs:annotation>
<xs:documentation xml:lang='en'>
This schema is intended to define all of the XML components used
by Tritium. The top-most element is <tritium>, which is a
container for miscellaneous XML data (not just Tritium XML
data). It is intended to contain elements like <presets>
(which may also be top-level elements).
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation xml:lang='en'>
The lax structure is mostly done for future-compatibility. The
namespace above will be used until a non-backwards-compatable
change is made. For example, when first published the only
elements was <presets>. Because <tritium> has a lax
structure, it's possible to later add a <sample> or
<song>. Those files will be able to be opened without
issue with an older version of Composite. (Of course, the new
content will fail to load... but the old content will work
fine.)
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation xml:lang='en'>
Note that Hydrogen's XML schemas are not a part of this schema.
</xs:documentation>
</xs:annotation>
<!-- ###############################################################
### REUSABLE BASIC TYPES ###
###############################################################
-->
<xs:attributeGroup name='common_attributes'>
<xs:attribute name='id' type='xs:ID' use='optional' />
<xs:anyAttribute/>
</xs:attributeGroup>
<xs:complexType name='common_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
This is the base type that holds common attributes for all
elements in this schema.
</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref='T:common_attributes' />
</xs:complexType>
<xs:simpleType name='midi_integer'>
<xs:restriction base='xs:integer'>
<xs:minInclusive value='0'/>
<xs:maxInclusive value='127'/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name='meta_Type' mixed='true'>
<xs:annotation>
<xs:documentation xml:lang='en'>
This is a placeholder for a future metadata type.
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs='0' maxOccurs='unbounded'>
<xs:any processContents='lax'/>
</xs:choice>
<xs:attributeGroup ref='T:common_attributes' />
</xs:complexType>
<!-- ###############################################################
### TOP LEVEL ELEMENT DEFINITION ###
###############################################################
-->
<xs:element name='tritium' type='T:tritium_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
This is the top-level element for the Tritium XML schemas. It
is able to hold any kind of content... however it is intended
to be a container for Tritium-specific content.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name='tritium_Type' mixed='false'>
<xs:sequence minOccurs='0' maxOccurs='1'>
<xs:element name='meta' type='T:meta_Type' minOccurs='0' maxOccurs='1'/>
<xs:any processContents='lax' minOccurs='0' maxOccurs='unbounded' />
</xs:sequence>
<xs:attributeGroup ref='T:common_attributes' />
</xs:complexType>
<xs:element name='presets' type='T:presets_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
The presets element is simply a container for several
<bank> elements. There must be at least one
<bank>.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name='presets_Type'>
<xs:complexContent>
<xs:restriction base='T:common_Type'>
<xs:sequence minOccurs='0' maxOccurs='1'>
<xs:element ref='T:meta' minOccurs='0' maxOccurs='1'/>
<xs:element name='bank' type='T:bank_Type'
minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:element name='meta' type='T:meta_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
Thie is a placeholder for a future metadata element.
Processors should ignore its contents until it is defined.
Documents should /not/ contain a meta element until it is
established. However, having it in the schema documents the
future intention for where it will appear.
</xs:documentation>
</xs:annotation>
</xs:element>
<!-- ###############################################################
### DETAILED ELEMENT TYPE DEFITIONS ###
###############################################################
-->
<xs:complexType name='bank_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
This corresponds to a MIDI Bank selection (MIDI CC# 0/coarse
and 32/fine). It defines which bank this is for, and is a
container for several <program> or "preset" definitions.
</xs:documentation>
</xs:annotation>
<xs:sequence minOccurs='0' maxOccurs='1'>
<xs:element ref='T:meta' minOccurs='0' maxOccurs='1' />
<xs:element name='program' type='T:program_Type'
minOccurs='0' maxOccurs='unbounded' />
</xs:sequence>
<xs:attribute name='coarse' type='T:midi_integer' default='0'/>
<xs:attribute name='fine' type='T:midi_integer' default='0'/>
<xs:attributeGroup ref='T:common_attributes'/>
</xs:complexType>
<xs:complexType name='program_Type'>
<xs:annotation>
<xs:documentation xml:lang='en'>
And individual program/preset that maps a PC event to a
resource that should be loaded.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name='midi_number'>
<xs:annotation>
<xs:documentation xml:lang='en'>
This directly corresponds exactly to the Program Change number
that is sent in the MIDI message.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='T:midi_integer'>
<xs:attributeGroup ref='T:common_attributes'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='resource'>
<xs:annotation>
<xs:documentation xml:lang='en'>
The URL to a Composite resource file. May be any valid file
that can be loaded into Composite, including a 'presets'
definition file.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:anyURI'>
<xs:attributeGroup ref='T:common_attributes'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:any minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attributeGroup ref='T:common_attributes'/>
</xs:complexType>
</xs:schema>
|