| 1 |
|
| 2 |
<!DOCTYPE xsd:schema SYSTEM "/home/beda/xml/schema/schema.dtd" [ |
| 3 |
<!ENTITY % p 'xsd:'> |
| 4 |
<!ENTITY % s ':xsd'> |
| 5 |
]> |
| 6 |
|
| 7 |
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> |
| 8 |
|
| 9 |
<xsd:element name="cdml"> |
| 10 |
<xsd:annotation> |
| 11 |
<xsd:documentation>The root element of all BKChem CDML documents</xsd:documentation> |
| 12 |
</xsd:annotation> |
| 13 |
<xsd:complexType> |
| 14 |
<xsd:sequence> |
| 15 |
<xsd:element name="header" type="header"/> |
| 16 |
<xsd:element name="chemistry" type="chemistry"/> |
| 17 |
<xsd:element name="graphics" type="graphics"/> |
| 18 |
<xsd:element name="styles" type="styles"/> |
| 19 |
<xsd:element name="data" type="data"/> |
| 20 |
</xsd:sequence> |
| 21 |
<xsd:attribute name="version" type="xsd:string"/> |
| 22 |
</xsd:complexType> |
| 23 |
</xsd:element> |
| 24 |
|
| 25 |
|
| 26 |
<xsd:complexType name="header"> |
| 27 |
<xsd:annotation> |
| 28 |
<xsd:documentation>Contains document metadata</xsd:documentation> |
| 29 |
</xsd:annotation> |
| 30 |
<xsd:sequence> |
| 31 |
<xsd:element name="author" type="xsd:string"/> |
| 32 |
|
| 33 |
<xsd:element name="application"> |
| 34 |
<xsd:annotation> |
| 35 |
<xsd:documentation>Application used to create this document</xsd:documentation> |
| 36 |
</xsd:annotation> |
| 37 |
<xsd:complexType> |
| 38 |
<xsd:simpleContent> |
| 39 |
<xsd:extension base="xsd:string"> |
| 40 |
<xsd:attribute name="version" type="xsd:string"/> |
| 41 |
</xsd:extension> |
| 42 |
</xsd:simpleContent> |
| 43 |
</xsd:complexType> |
| 44 |
</xsd:element> |
| 45 |
|
| 46 |
<xsd:element name="info" type="xsd:string"/> |
| 47 |
</xsd:sequence> |
| 48 |
</xsd:complexType> |
| 49 |
|
| 50 |
|
| 51 |
<xsd:complexType name="chemistry"> |
| 52 |
<xsd:sequence> |
| 53 |
<xsd:element name="molecule" type="molecule" minOccurs="0" maxOccurs="unbounded"/> |
| 54 |
<xsd:element name="reaction" type="reaction" minOccurs="0" maxOccurs="unbounded"/> |
| 55 |
</xsd:sequence> |
| 56 |
</xsd:complexType> |
| 57 |
|
| 58 |
<xsd:complexType name="molecule"> |
| 59 |
<xsd:sequence> |
| 60 |
<xsd:element name="name" type="rich-text" minOccurs="0" maxOccurs="unbounded"/> |
| 61 |
<xsd:element name="template"> |
| 62 |
<xsd:complexType> |
| 63 |
<xsd:attribute name="bond1" type="xsd:IDREF"/> |
| 64 |
<xsd:attribute name="bond2" type="xsd:IDREF"/> |
| 65 |
<xsd:attribute name="atom" type="xsd:IDREF"/> |
| 66 |
</xsd:complexType> |
| 67 |
</xsd:element> |
| 68 |
<xsd:element name="atom" type="atom" minOccurs="1" maxOccurs="unbounded"/> |
| 69 |
<xsd:element name="bond" type="bond" minOccurs="0" maxOccurs="unbounded"/> |
| 70 |
</xsd:sequence> |
| 71 |
<xsd:attribute name="id" type="xsd:ID"/> |
| 72 |
</xsd:complexType> |
| 73 |
|
| 74 |
<xsd:complexType name="atom"> |
| 75 |
<xsd:sequence> |
| 76 |
<xsd:element name="point" type="point"/> |
| 77 |
<xsd:element name="text" type="rich-text"/> |
| 78 |
</xsd:sequence> |
| 79 |
<xsd:attribute name="id" type="xsd:ID"/> |
| 80 |
<xsd:attribute name="name" type="xsd:string"/> |
| 81 |
<xsd:attribute name="charge"> |
| 82 |
<xsd:simpleType> |
| 83 |
<xsd:restriction base="xsd:integer"> |
| 84 |
<xsd:minInclusive value="-8"/> |
| 85 |
<xsd:maxInclusive value="8"/> |
| 86 |
</xsd:restriction> |
| 87 |
</xsd:simpleType> |
| 88 |
</xsd:attribute> |
| 89 |
<xsd:attribute name="number" type="xsd:string"/> |
| 90 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 91 |
</xsd:complexType> |
| 92 |
|
| 93 |
<xsd:complexType name="point"> |
| 94 |
<xsd:attribute name="x" type="xsd:decimal" use="required"/> |
| 95 |
<xsd:attribute name="y" type="xsd:decimal" use="required"/> |
| 96 |
<xsd:attribute name="z" type="xsd:decimal" use="optional"/> |
| 97 |
</xsd:complexType> |
| 98 |
|
| 99 |
<xsd:complexType name="bond"> |
| 100 |
<xsd:attribute name="id" type="xsd:ID"/> |
| 101 |
<xsd:attribute name="order" type="bond-order"/> |
| 102 |
<xsd:attribute name="stereo" type="bond-stereo"/> |
| 103 |
<xsd:attribute name="atom1" type="xsd:IDREF" use="required"/> |
| 104 |
<xsd:attribute name="atom2" type="xsd:IDREF" use="required"/> |
| 105 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 106 |
</xsd:complexType> |
| 107 |
|
| 108 |
<xsd:complexType name="reaction"> |
| 109 |
</xsd:complexType> |
| 110 |
|
| 111 |
|
| 112 |
<xsd:complexType name="graphics"> |
| 113 |
<xsd:sequence> |
| 114 |
<xsd:element name="stack"> |
| 115 |
<xsd:complexType> |
| 116 |
<xsd:attribute name="stack"> |
| 117 |
<xsd:simpleType> |
| 118 |
<xsd:list itemType="xsd:IDREF"/> |
| 119 |
</xsd:simpleType> |
| 120 |
</xsd:attribute> |
| 121 |
</xsd:complexType> |
| 122 |
</xsd:element> |
| 123 |
<xsd:choice minOccurs="0" maxOccurs="unbounded"> |
| 124 |
<xsd:element name="rect" type="rectangular-object"/> |
| 125 |
<xsd:element name="square" type="rectangular-object"/> |
| 126 |
<xsd:element name="oval" type="rectangular-object"/> |
| 127 |
<xsd:element name="circle" type="rectangular-object"/> |
| 128 |
<xsd:element name="polygon" type="polygon"/> |
| 129 |
<xsd:element name="arrow" type="arrow"/> |
| 130 |
<xsd:element name="plus" type="plus"/> |
| 131 |
<xsd:element name="text" type="text"/> |
| 132 |
</xsd:choice> |
| 133 |
</xsd:sequence> |
| 134 |
</xsd:complexType> |
| 135 |
|
| 136 |
<xsd:complexType name="rectangular-object"> |
| 137 |
<xsd:sequence> |
| 138 |
<xsd:element name="point" type="point" minOccurs="2" maxOccurs="2"/> |
| 139 |
</xsd:sequence> |
| 140 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 141 |
</xsd:complexType> |
| 142 |
|
| 143 |
<xsd:complexType name="polygon"> |
| 144 |
<xsd:sequence> |
| 145 |
<xsd:element name="point" type="point" minOccurs="3" maxOccurs="unbounded"/> |
| 146 |
</xsd:sequence> |
| 147 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 148 |
</xsd:complexType> |
| 149 |
|
| 150 |
<xsd:complexType name="arrow"> |
| 151 |
<xsd:sequence> |
| 152 |
<xsd:element name="point" type="point" minOccurs="2" maxOccurs="unbounded"/> |
| 153 |
</xsd:sequence> |
| 154 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 155 |
<xsd:attribute name="start" type="xsd:boolean"/> |
| 156 |
<xsd:attribute name="end" type="xsd:boolean"/> |
| 157 |
<xsd:attribute name="spline" type="xsd:boolean"/> |
| 158 |
</xsd:complexType> |
| 159 |
|
| 160 |
<xsd:complexType name="plus"> |
| 161 |
<xsd:sequence> |
| 162 |
<xsd:element name="point" type="point" minOccurs="1" maxOccurs="1"/> |
| 163 |
</xsd:sequence> |
| 164 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 165 |
</xsd:complexType> |
| 166 |
|
| 167 |
<xsd:complexType name="text"> |
| 168 |
<xsd:sequence> |
| 169 |
<xsd:element name="point" type="point" minOccurs="1" maxOccurs="1"/> |
| 170 |
<xsd:element name="text" type="rich-text"/> |
| 171 |
</xsd:sequence> |
| 172 |
<xsd:attribute name="style" type="xsd:IDREF"/> |
| 173 |
</xsd:complexType> |
| 174 |
|
| 175 |
<!-- STYLES --> |
| 176 |
|
| 177 |
<xsd:complexType name="styles"> |
| 178 |
<xsd:sequence> |
| 179 |
<xsd:element name="default-style" type="style"/> |
| 180 |
<xsd:element name="style" type="style" minOccurs="0" maxOccurs="unbounded"/> |
| 181 |
</xsd:sequence> |
| 182 |
</xsd:complexType> |
| 183 |
|
| 184 |
|
| 185 |
<xsd:complexType name="style"> |
| 186 |
<xsd:sequence> |
| 187 |
<xsd:element name="fonts" type="font"/> |
| 188 |
<xsd:element name="colors"> |
| 189 |
<xsd:complexType> |
| 190 |
<xsd:attribute name="fill-color" type="color"/> |
| 191 |
<xsd:attribute name="outline-color" type="color"/> |
| 192 |
</xsd:complexType> |
| 193 |
</xsd:element> |
| 194 |
<xsd:element name="bonds"> |
| 195 |
<xsd:complexType> |
| 196 |
<xsd:attribute name="width"> |
| 197 |
<xsd:simpleType> |
| 198 |
<xsd:restriction base="xsd:decimal"> |
| 199 |
<xsd:minInclusive value="1"/> |
| 200 |
<xsd:maxInclusive value="100"/> |
| 201 |
</xsd:restriction> |
| 202 |
</xsd:simpleType> |
| 203 |
</xsd:attribute> |
| 204 |
</xsd:complexType> |
| 205 |
</xsd:element> |
| 206 |
<xsd:element name="atoms"> |
| 207 |
<xsd:complexType> |
| 208 |
<xsd:attribute name="hydrogens" type="xsd:boolean"/> |
| 209 |
<xsd:attribute name="show-number" type="xsd:boolean"/> |
| 210 |
<xsd:attribute name="text-positioning"> |
| 211 |
<xsd:simpleType> |
| 212 |
<xsd:restriction base="xsd:string"> |
| 213 |
<xsd:enumeration value="center-last"/> |
| 214 |
<xsd:enumeration value="center-first"/> |
| 215 |
</xsd:restriction> |
| 216 |
</xsd:simpleType> |
| 217 |
</xsd:attribute> |
| 218 |
</xsd:complexType> |
| 219 |
</xsd:element> |
| 220 |
</xsd:sequence> |
| 221 |
<xsd:attribute name="id" type="xsd:ID"/> |
| 222 |
<xsd:attribute name="line-width"> |
| 223 |
<xsd:simpleType> |
| 224 |
<xsd:restriction base="xsd:decimal"> |
| 225 |
<xsd:minInclusive value="0.1"/> |
| 226 |
<xsd:maxInclusive value="100"/> |
| 227 |
</xsd:restriction> |
| 228 |
</xsd:simpleType> |
| 229 |
</xsd:attribute> |
| 230 |
</xsd:complexType> |
| 231 |
|
| 232 |
|
| 233 |
<!-- DATA --> |
| 234 |
|
| 235 |
<xsd:complexType name="data"> |
| 236 |
</xsd:complexType> |
| 237 |
|
| 238 |
|
| 239 |
<!-- helper types used in the schema --> |
| 240 |
|
| 241 |
<xsd:simpleType name="rgb-single"> |
| 242 |
<xsd:restriction base="xsd:nonNegativeInteger"> |
| 243 |
<xsd:maxInclusive value="255"/> |
| 244 |
</xsd:restriction> |
| 245 |
</xsd:simpleType> |
| 246 |
|
| 247 |
<xsd:simpleType name="rgb-list"> |
| 248 |
<xsd:list itemType="rgb-single"/> |
| 249 |
</xsd:simpleType> |
| 250 |
|
| 251 |
<xsd:simpleType name="rgb-triade"> |
| 252 |
<xsd:restriction base="xsd:rgb-list"> |
| 253 |
<xsd:length value="3"/> |
| 254 |
</xsd:restriction> |
| 255 |
</xsd:simpleType> |
| 256 |
|
| 257 |
<xsd:simpleType name="rgb-hex"> |
| 258 |
<xsd:restriction base="xsd:string"> |
| 259 |
<xsd:pattern value="#(\d|[abcdef]){6}"/> |
| 260 |
</xsd:restriction> |
| 261 |
</xsd:simpleType> |
| 262 |
|
| 263 |
<xsd:simpleType name="color"> |
| 264 |
<xsd:annotation> |
| 265 |
<xsd:documentation>RGB color either in #rrggbb format or in 'r g b' format</xsd:documentation> |
| 266 |
</xsd:annotation> |
| 267 |
<xsd:union memberTypes="rgb-hex rgb-triade"/> |
| 268 |
</xsd:simpleType> |
| 269 |
|
| 270 |
<xsd:complexType name="rich-text" mixed="true"> |
| 271 |
<xsd:choice minOccurs="0" maxOccurs="unbounded"> |
| 272 |
<xsd:element name="sub" type="rich-text"/> |
| 273 |
<xsd:element name="sup" type="rich-text"/> |
| 274 |
<xsd:element name="b" type="b"/> |
| 275 |
<xsd:element name="i" type="i"/> |
| 276 |
</xsd:choice> |
| 277 |
</xsd:complexType> |
| 278 |
|
| 279 |
<xsd:complexType name="b" mixed="true"> |
| 280 |
<xsd:choice minOccurs="0" maxOccurs="unbounded"> |
| 281 |
<xsd:element name="sub" type="rich-text"/> |
| 282 |
<xsd:element name="sup" type="rich-text"/> |
| 283 |
<xsd:element name="i" type="i"/> |
| 284 |
</xsd:choice> |
| 285 |
</xsd:complexType> |
| 286 |
|
| 287 |
<xsd:complexType name="i" mixed="true"> |
| 288 |
<xsd:choice minOccurs="0" maxOccurs="unbounded"> |
| 289 |
<xsd:element name="sub" type="rich-text"/> |
| 290 |
<xsd:element name="sup" type="rich-text"/> |
| 291 |
<xsd:element name="b" type="b"/> |
| 292 |
</xsd:choice> |
| 293 |
</xsd:complexType> |
| 294 |
|
| 295 |
<xsd:complexType name="font"> |
| 296 |
<xsd:attribute name="family" type="xsd:string"/> |
| 297 |
<xsd:attribute name="size" type="xsd:positiveInteger"/> |
| 298 |
<xsd:attribute name="weight" use="optional"> |
| 299 |
<xsd:simpleType> |
| 300 |
<xsd:restriction base="xsd:string"> |
| 301 |
<xsd:enumeration value="bold"/> |
| 302 |
<xsd:enumeration value="b"/> |
| 303 |
<xsd:enumeration value="normal"/> |
| 304 |
<xsd:enumeration value="n"/> |
| 305 |
</xsd:restriction> |
| 306 |
</xsd:simpleType> |
| 307 |
</xsd:attribute> |
| 308 |
<xsd:attribute name="style" use="optional"> |
| 309 |
<xsd:simpleType> |
| 310 |
<xsd:restriction base="xsd:string"> |
| 311 |
<xsd:enumeration value="italic"/> |
| 312 |
<xsd:enumeration value="i"/> |
| 313 |
<xsd:enumeration value="normal"/> |
| 314 |
<xsd:enumeration value="n"/> |
| 315 |
</xsd:restriction> |
| 316 |
</xsd:simpleType> |
| 317 |
</xsd:attribute> |
| 318 |
</xsd:complexType> |
| 319 |
|
| 320 |
<xsd:simpleType name="bond-order"> |
| 321 |
<xsd:restriction base="xsd:string"> |
| 322 |
<xsd:enumeration value="1"/> |
| 323 |
<xsd:enumeration value="2"/> |
| 324 |
<xsd:enumeration value="3"/> |
| 325 |
<xsd:enumeration value="s"/> |
| 326 |
<xsd:enumeration value="d"/> |
| 327 |
<xsd:enumeration value="t"/> |
| 328 |
<xsd:enumeration value="single"/> |
| 329 |
<xsd:enumeration value="double"/> |
| 330 |
<xsd:enumeration value="triple"/> |
| 331 |
</xsd:restriction> |
| 332 |
</xsd:simpleType> |
| 333 |
|
| 334 |
<xsd:simpleType name="bond-stereo"> |
| 335 |
<xsd:restriction base="xsd:string"> |
| 336 |
<xsd:enumeration value="n"/> |
| 337 |
<xsd:enumeration value="w"/> |
| 338 |
<xsd:enumeration value="h"/> |
| 339 |
<xsd:enumeration value="N"/> |
| 340 |
<xsd:enumeration value="W"/> |
| 341 |
<xsd:enumeration value="H"/> |
| 342 |
<xsd:enumeration value="normal"/> |
| 343 |
<xsd:enumeration value="wedge"/> |
| 344 |
<xsd:enumeration value="hatch"/> |
| 345 |
</xsd:restriction> |
| 346 |
</xsd:simpleType> |
| 347 |
|
| 348 |
|
| 349 |
</xsd:schema> |