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