comparison toolboxes/xml_toolbox/matlab.xsd @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 <!-- Copyright 2002 Geodise Project, University of Southampton -->
2 <!-- matlab.xsd - Jasmin Wason - 01/11/02 -->
3 <!-- Schema to validate XML documents generated by the xml_save function -->
4 <!-- of the XML Toolbox for Matlab written by Marc Molinari. -->
5 <!-- Modification 14/11/02 Jasmin Wason -->
6 <!-- Included a definition for the complex element -->
7 <!-- Modification 27/11/02 Jasmin Wason -->
8 <!-- Added complex element as a child of struct, sparse and cell -->
9 <xs:schema targetNamespace="http://www.geodise.org/matlab.xsd" xmlns="http://www.geodise.org/matlab.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
10 <!-- struct element definition -->
11 <!-- A struct element contains 0 or more struct, double, char, sparse, cell or complex elements -->
12 <!-- These child elements may appear in any order -->
13 <!-- A struct element contains a list of attributes as described in the structAttributes attributeGroup -->
14 <xs:element name="struct">
15 <xs:complexType>
16 <xs:choice minOccurs="0" maxOccurs="unbounded">
17 <xs:element ref="struct" />
18 <xs:element ref="double" />
19 <xs:element ref="char" />
20 <xs:element ref="sparse" />
21 <xs:element ref="cell" />
22 <xs:element ref="complex" />
23 </xs:choice>
24 <xs:attributeGroup ref="structAttributes" />
25 </xs:complexType>
26 </xs:element>
27 <!-- double element definition -->
28 <!-- double may contain numerical entities of type integer, double, long etc -->
29 <!-- The content is a list of XSD doubles -->
30 <!-- and a list of attributes as described in the commonAttributes attributeGroup -->
31 <xs:element name="double">
32 <xs:complexType>
33 <xs:simpleContent>
34 <xs:extension base="listOfXsdDoubles">
35 <xs:attributeGroup ref="commonAttributes" />
36 </xs:extension>
37 </xs:simpleContent>
38 </xs:complexType>
39 </xs:element>
40 <!-- char element definition -->
41 <!-- char contains alphanumerical entities (characters, strings, etc.) -->
42 <!-- The content is an XSD string -->
43 <!-- and a list of attributes as described in the commonAttributes attributeGroup -->
44 <xs:element name="char">
45 <xs:complexType>
46 <xs:simpleContent>
47 <xs:extension base="xs:string">
48 <xs:attributeGroup ref="commonAttributes" />
49 </xs:extension>
50 </xs:simpleContent>
51 </xs:complexType>
52 </xs:element>
53 <!-- sparse element definition -->
54 <!-- sparse contains sparse matrices (2 arrays of type double and 1 array of type double or complex) -->
55 <!-- ([i], [j], [k]), S(i, j)=k) -->
56 <!-- A sparse element is either empty or contains -->
57 <!-- a list of 2 double + 1 double or complex element -->
58 <!-- and a list of attributes as described in the commonAttributes attributeGroup -->
59 <xs:element name="sparse">
60 <xs:complexType>
61 <xs:sequence minOccurs="0">
62 <xs:element ref="double" minOccurs="2" maxOccurs="2" />
63 <xs:choice>
64 <xs:element ref="double" minOccurs="1" maxOccurs="1" />
65 <xs:element ref="complex" minOccurs="1" maxOccurs="1" />
66 </xs:choice>
67 </xs:sequence>
68 <xs:attributeGroup ref="commonAttributes" />
69 </xs:complexType>
70 </xs:element>
71 <!-- cell element definition -->
72 <!-- cell contains cell entities -->
73 <!-- A cell element contains 0 or more struct, double, char, sparse, cell or complex elements -->
74 <!-- These child elements may appear in any order -->
75 <!-- A cell element contains a list of attributes as described in the commonAttributes attributeGroup -->
76 <xs:element name="cell">
77 <xs:complexType>
78 <xs:choice minOccurs="0" maxOccurs="unbounded">
79 <xs:element ref="struct" />
80 <xs:element ref="double" />
81 <xs:element ref="char" />
82 <xs:element ref="sparse" />
83 <xs:element ref="cell" />
84 <xs:element ref="complex" />
85 </xs:choice>
86 <xs:attributeGroup ref="commonAttributes" />
87 </xs:complexType>
88 </xs:element>
89 <!-- complex element definition -->
90 <!-- complex contains complex numbers a+ib with real part a and imaginary part b, which are both represented by entries of type double -->
91 <!-- A complex element contains a list of either 2 or 0 double elements -->
92 <!-- and a list of attributes as described in the commonAttributes attributeGroup -->
93 <xs:element name="complex">
94 <xs:complexType>
95 <xs:sequence>
96 <xs:element name="double" minOccurs="2" maxOccurs="2">
97 <xs:complexType>
98 <xs:simpleContent>
99 <xs:extension base="nonEmptyListOfXsdDoubles">
100 <xs:attributeGroup ref="commonAttributes" />
101 </xs:extension>
102 </xs:simpleContent>
103 </xs:complexType>
104 </xs:element>
105 </xs:sequence>
106 <xs:attributeGroup ref="commonAttributes" />
107 </xs:complexType>
108 </xs:element>
109 <!-- commonAttributes is a list of attributes that all struct, double, char, sparse and cell elements have -->
110 <xs:attributeGroup name="commonAttributes">
111 <xs:attribute name="idx" type="xs:integer" use="required" />
112 <xs:attribute name="name" type="xs:string" use="optional" />
113 <xs:attribute name="size" type="listOfXsdInts" use="optional" default="1 1" />
114 <!-- idx indicates what position in the parent array this element belongs. For root element i="0" -->
115 <!-- name represents the name of the current element inside a structure -->
116 <!-- name only occurs in elements inside a structure, although this schema does not enforce this rule -->
117 <!-- size represents the size of the entry. It allows Matlab to form matrices from vectors with reshape() -->
118 </xs:attributeGroup>
119 <!-- structAttributes is a list of attributes that all struct elements have -->
120 <xs:attributeGroup name="structAttributes">
121 <xs:attributeGroup ref="commonAttributes" />
122 <xs:attribute name="fields" type="listOfXsdStrings" use="optional" />
123 <!-- Include all the attributes in commonAttributes -->
124 <!-- fields contains the field names of a structure. -->
125 </xs:attributeGroup>
126 <!-- listOfXsdDoubles is a type describing a list of xs:doubles -->
127 <!-- i.e. a double as defined by the XML Schema specification, not matlab.xsd -->
128 <xs:simpleType name="listOfXsdDoubles">
129 <xs:list itemType="xs:double" />
130 </xs:simpleType>
131 <!-- nonEmptyListOfXsdDoubles is a type describing a list of xs:doubles -->
132 <!-- with length at least 1 -->
133 <xs:simpleType name="nonEmptyListOfXsdDoubles">
134 <xs:restriction base="listOfXsdDoubles">
135 <xs:minLength value="1" />
136 </xs:restriction>
137 </xs:simpleType>
138 <!-- listOfXsdInts is a type describing a list of integers -->
139 <xs:simpleType name="listOfXsdInts">
140 <xs:list itemType="xs:int" />
141 </xs:simpleType>
142 <!-- listOfXsdStrings is a type describing a list of strings -->
143 <xs:simpleType name="listOfXsdStrings">
144 <xs:list itemType="xs:string" />
145 </xs:simpleType>
146 </xs:schema>