annotate src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng @ 0:0961a4a21176

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children 31822b475baa
rev   line source
duke@0 1 <?xml version="1.0"?>
duke@0 2 <grammar xmlns="http://relaxng.org/ns/structure/1.0"
duke@0 3 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
duke@0 4 ns="http://www.w3.org/2001/XMLSchema"
duke@0 5 xmlns:xs="http://www.w3.org/2001/XMLSchema"
duke@0 6 xmlns:doc="http://www.jenitennison.com/doc"
duke@0 7 xmlns:txw="http://java.sun.com/txw">
duke@0 8
duke@0 9 <doc:p>
duke@0 10 RELAX NG schema for XML Schema by <doc:link
duke@0 11 href="mailto:mail@jenitennison.com">Jeni Tennison</doc:link>. Based on
duke@0 12 <doc:link href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML
duke@0 13 Schema Part I: Structures Recommendation</doc:link> and <doc:link
duke@0 14 href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">XML Schema Part
duke@0 15 II: Datatypes</doc:link>.
duke@0 16 </doc:p>
duke@0 17 <doc:changes date="2001-11-24">
duke@0 18 <doc:p>
duke@0 19 Amended to comply with 10 August 2001 Tutorial.
duke@0 20 </doc:p>
duke@0 21 <doc:change>Removed key attributes.</doc:change>
duke@0 22 <doc:change>Replaced not element with except elements.</doc:change>
duke@0 23 <doc:change>
duke@0 24 Replaced multiple consecutive optional attributes to use the
duke@0 25 zeroOrMore/choice pattern.
duke@0 26 </doc:change>
duke@0 27 <doc:change>
duke@0 28 Removed interleave elements inside list elements (which are no longer
duke@0 29 permitted).
duke@0 30 </doc:change>
duke@0 31 </doc:changes>
duke@0 32
duke@0 33 <define name="openAttrs" txw:mode="inherit">
duke@0 34 <doc:p>
duke@0 35 This allows any number of attributes that are not in the XML Schema
duke@0 36 namespace or are in no namespace. This is somewhat more complicated than
duke@0 37 the XML Schema anyAttribute equivalent.
duke@0 38 </doc:p>
duke@0 39 <!-- KK don't care -->
duke@0 40 <empty/>
duke@0 41 <!--zeroOrMore>
duke@0 42 <attribute>
duke@0 43 <anyName>
duke@0 44 <except>
duke@0 45 <nsName />
duke@0 46 <nsName ns="" />
duke@0 47 <name>xml:lang</name>
duke@0 48 </except>
duke@0 49 </anyName>
duke@0 50 <text />
duke@0 51 </attribute>
duke@0 52 </zeroOrMore-->
duke@0 53 </define>
duke@0 54
duke@0 55 <define name="annotated" txw:mode="inherit">
duke@0 56 <doc:p>
duke@0 57 This allows any number of attributes that are not in the XML Schema
duke@0 58 namespace or are in no namespace, an optional id attribute of type ID,
duke@0 59 and an optional annotation element. This is used as the basis for many
duke@0 60 element content models.
duke@0 61 </doc:p>
duke@0 62 <ref name="openAttrs" />
duke@0 63 <optional>
duke@0 64 <attribute name="id">
duke@0 65 <data type="ID" />
duke@0 66 </attribute>
duke@0 67 </optional>
duke@0 68 <optional>
duke@0 69 <ref name="annotation" />
duke@0 70 </optional>
duke@0 71 </define>
duke@0 72
duke@0 73 <define name="schemaTop" txw:mode="inline">
duke@0 74 <doc:p>
duke@0 75 This gives the content model of the top level of the schema.
duke@0 76 </doc:p>
duke@0 77 <choice>
duke@0 78 <ref name="redefinable" />
duke@0 79 <ref name="topLevelElement" />
duke@0 80 <ref name="topLevelAttribute" />
duke@0 81 <!--ref name="notation" /-->
duke@0 82 </choice>
duke@0 83 </define>
duke@0 84
duke@0 85 <define name="redefinable" txw:mode="inline">
duke@0 86 <doc:p>
duke@0 87 This gives the components that can be redefined within the redefine
duke@0 88 element. They also occur at the top level of the schema.
duke@0 89 </doc:p>
duke@0 90 <choice>
duke@0 91 <ref name="simpleTypeHost" />
duke@0 92 <ref name="complexTypeHost" />
duke@0 93 <!--ref name="namedGroup" />
duke@0 94 <ref name="namedAttributeGroup" /-->
duke@0 95 </choice>
duke@0 96 </define>
duke@0 97
duke@0 98 <define name="formChoice">
duke@0 99 <doc:p>
duke@0 100 This gives the values for the various form attributes:
duke@0 101 elementFormDefault and attributeFormDefault on the schema element, and
duke@0 102 the form attributes on the element and attribute elements.
duke@0 103 </doc:p>
duke@0 104 <choice>
duke@0 105 <value>qualified</value>
duke@0 106 <value>unqualified</value>
duke@0 107 </choice>
duke@0 108 </define>
duke@0 109
duke@0 110 <!-- KK: merge the two -->
duke@0 111 <define name="reducedDerivationControl">
duke@0 112 <doc:p>
duke@0 113 This gives the values that can be taken in the lists used to control
duke@0 114 derivation by extension or restriction (this is 'reduced' derivation
duke@0 115 because some derivation can involve substitution). This RELAX NG schema,
duke@0 116 like the XML Schema Recommendation here, allows the keywords 'extension' and
duke@0 117 'restriction' to be repeated any number of times.
duke@0 118 </doc:p>
duke@0 119 <list>
duke@0 120 <oneOrMore>
duke@0 121 <choice>
duke@0 122 <value>extension</value>
duke@0 123 <value>restriction</value>
duke@0 124 </choice>
duke@0 125 </oneOrMore>
duke@0 126 </list>
duke@0 127 </define>
duke@0 128
duke@0 129 <define name="derivationSet">
duke@0 130 <doc:p>
duke@0 131 This specifies the possible values for attributes that control derivation.
duke@0 132 </doc:p>
duke@0 133 <choice>
duke@0 134 <value>#all</value>
duke@0 135 <ref name="reducedDerivationControl" />
duke@0 136 </choice>
duke@0 137 </define>
duke@0 138
duke@0 139 <start>
duke@0 140 <doc:p>
duke@0 141 This is the beginning point for the schema, and defines the schema
duke@0 142 element.
duke@0 143 </doc:p>
duke@0 144 <element name="schema"
duke@0 145 doc:href="http://www.w3.org/TR/xmlschema-1/#element-schema">
duke@0 146 <ref name="openAttrs" />
duke@0 147 <zeroOrMore>
duke@0 148 <choice>
duke@0 149 <attribute name="version">
duke@0 150 <data type="token" />
duke@0 151 </attribute>
duke@0 152 <attribute name="finalDefault">
duke@0 153 <ref name="derivationSet" />
duke@0 154 </attribute>
duke@0 155 <attribute name="blockDefault">
duke@0 156 <ref name="blockSet" />
duke@0 157 </attribute>
duke@0 158 <attribute name="attributeFormDefault">
duke@0 159 <ref name="formChoice" />
duke@0 160 </attribute>
duke@0 161 <attribute name="elementFormDefault">
duke@0 162 <ref name="formChoice" />
duke@0 163 </attribute>
duke@0 164 <attribute name="id">
duke@0 165 <data type="ID" />
duke@0 166 </attribute>
duke@0 167 <attribute name="xml:lang">
duke@0 168 <data type="language" />
duke@0 169 </attribute>
duke@0 170 <attribute name="targetNamespace">
duke@0 171 <data type="anyURI" />
duke@0 172 </attribute>
duke@0 173 </choice>
duke@0 174 </zeroOrMore>
duke@0 175 <zeroOrMore>
duke@0 176 <choice>
duke@0 177 <!--ref name="include" /-->
duke@0 178 <ref name="import" />
duke@0 179 <!--ref name="redefine" /-->
duke@0 180 <ref name="annotation" />
duke@0 181 </choice>
duke@0 182 </zeroOrMore>
duke@0 183 <zeroOrMore>
duke@0 184 <choice>
duke@0 185 <ref name="schemaTop" />
duke@0 186 <ref name="annotation" />
duke@0 187 </choice>
duke@0 188 </zeroOrMore>
duke@0 189 </element>
duke@0 190 </start>
duke@0 191
duke@0 192 <define name="allNNI">
duke@0 193 <doc:p>
duke@0 194 This gives the value type for the maxOccurs attribute, which may be a
duke@0 195 non-negative number or the keyword 'unbounded'.
duke@0 196 </doc:p>
duke@0 197 <choice>
duke@0 198 <data type="nonNegativeInteger" />
duke@0 199 <value type="token">unbounded</value>
duke@0 200 </choice>
duke@0 201 </define>
duke@0 202
duke@0 203 <define name="occurs" txw:mode="inherit">
duke@0 204 <doc:p>
duke@0 205 This specifies the occurs attributes, minOccurs and maxOccurs, as they
duke@0 206 are normally used.
duke@0 207 </doc:p>
duke@0 208 <zeroOrMore>
duke@0 209 <choice>
duke@0 210 <attribute name="minOccurs">
duke@0 211 <data type="nonNegativeInteger" />
duke@0 212 </attribute>
duke@0 213 <attribute name="maxOccurs">
duke@0 214 <ref name="allNNI" />
duke@0 215 </attribute>
duke@0 216 </choice>
duke@0 217 </zeroOrMore>
duke@0 218 </define>
duke@0 219
duke@0 220 <define name="typeDefParticle" txw:mode="inline">
duke@0 221 <doc:p>
duke@0 222 This gives the possible content of complex types.
duke@0 223 </doc:p>
duke@0 224 <choice>
duke@0 225 <!--ref name="groupRef" /-->
duke@0 226 <ref name="all" />
duke@0 227 <ref name="choice" />
duke@0 228 <ref name="sequence" />
duke@0 229 </choice>
duke@0 230 </define>
duke@0 231
duke@0 232 <define name="nestedParticle" txw:mode="inline">
duke@0 233 <doc:p>
duke@0 234 This gives the particles that can make up a model group.
duke@0 235 </doc:p>
duke@0 236 <choice>
duke@0 237 <ref name="localElement" />
duke@0 238 <!--ref name="groupRef" /-->
duke@0 239 <ref name="choice" />
duke@0 240 <ref name="sequence" />
duke@0 241 <ref name="any" />
duke@0 242 </choice>
duke@0 243 </define>
duke@0 244
duke@0 245 <define name="fixedOrDefault" txw:mode="inline">
duke@0 246 <doc:p>
duke@0 247 This specifies the relationship between fixed and default attributes on
duke@0 248 element and attribute elements - if one is present, then the other cannot
duke@0 249 be. This is a constraint that cannot be specified using XML Schema.
duke@0 250 </doc:p>
duke@0 251 <choice>
duke@0 252 <empty />
duke@0 253 <attribute name="fixed" />
duke@0 254 <attribute name="default" />
duke@0 255 </choice>
duke@0 256 </define>
duke@0 257
duke@0 258 <define name="attributeType" txw:mode="inherit">
duke@0 259 <doc:p>
duke@0 260 This specifies the relationship between the type attribute and the
duke@0 261 simpleType element child of attribute elements - if one is present, then
duke@0 262 the other cannot be, although it is possible for neither to be allowed.
duke@0 263 </doc:p>
duke@0 264 <choice>
duke@0 265 <empty />
duke@0 266 <attribute name="type">
duke@0 267 <data type="QName" />
duke@0 268 </attribute>
duke@0 269 <ref name="simpleTypeHost" />
duke@0 270 </choice>
duke@0 271 </define>
duke@0 272
duke@0 273 <define name="localAttribute">
duke@0 274 <doc:p>
duke@0 275 This describes attribute elements when used in a local context. They
duke@0 276 have an optional use attribute, possibly a fixed or default attribute,
duke@0 277 and then can either have a ref attribute (referring to a top-level
duke@0 278 attribute) or a name attribute with an optional form attribute and
duke@0 279 specifying an attribute type.
duke@0 280 </doc:p>
duke@0 281 <element name="attribute"
duke@0 282 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute">
duke@0 283 <ref name="annotated" />
duke@0 284 <optional>
duke@0 285 <attribute name="use">
duke@0 286 <choice>
duke@0 287 <value type="token">optional</value>
duke@0 288 <value type="token">prohibited</value>
duke@0 289 <value type="token">required</value>
duke@0 290 </choice>
duke@0 291 </attribute>
duke@0 292 </optional>
duke@0 293 <ref name="fixedOrDefault" />
duke@0 294 <choice>
duke@0 295 <attribute name="ref">
duke@0 296 <data type="QName" />
duke@0 297 </attribute>
duke@0 298 <group>
duke@0 299 <attribute name="name">
duke@0 300 <data type="NCName" />
duke@0 301 </attribute>
duke@0 302 <optional>
duke@0 303 <attribute name="form">
duke@0 304 <ref name="formChoice" />
duke@0 305 </attribute>
duke@0 306 </optional>
duke@0 307 <ref name="attributeType" />
duke@0 308 </group>
duke@0 309 </choice>
duke@0 310 </element>
duke@0 311 </define>
duke@0 312
duke@0 313 <define name="topLevelAttribute">
duke@0 314 <doc:p>
duke@0 315 This describes attribute elements when used at the top level of the
duke@0 316 schema. They must have a name, may have a fixed or default attribute,
duke@0 317 and specify their type through a type attribute or child simpleType
duke@0 318 element. The name attribute of each attribute element that appears at
duke@0 319 the top level of the schema is unique.
duke@0 320 </doc:p>
duke@0 321 <element name="attribute"
duke@0 322 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute">
duke@0 323 <ref name="annotated" />
duke@0 324 <attribute name="name">
duke@0 325 <data type="NCName" />
duke@0 326 </attribute>
duke@0 327 <ref name="fixedOrDefault" />
duke@0 328 <ref name="attributeType" />
duke@0 329 </element>
duke@0 330 </define>
duke@0 331
duke@0 332 <define name="attrDecls" txw:mode="inherit">
duke@0 333 <doc:p>
duke@0 334 This gives the model group for specifying the attributes in a complex
duke@0 335 type, an extension or restriction.
duke@0 336 </doc:p>
duke@0 337 <zeroOrMore>
duke@0 338 <choice>
duke@0 339 <ref name="localAttribute" />
duke@0 340 <!--ref name="attributeGroupRef" /-->
duke@0 341 </choice>
duke@0 342 </zeroOrMore>
duke@0 343 <optional>
duke@0 344 <ref name="anyAttribute" />
duke@0 345 </optional>
duke@0 346 </define>
duke@0 347
duke@0 348 <define name="anyAttribute">
duke@0 349 <doc:p>
duke@0 350 This specifies the anyAttribute wildcard.
duke@0 351 </doc:p>
duke@0 352 <element name="anyAttribute"
duke@0 353 doc:href="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute">
duke@0 354 <ref name="wildcard" />
duke@0 355 </element>
duke@0 356 </define>
duke@0 357
duke@0 358 <define name="complexTypeModel" txw:mode="inherit">
duke@0 359 <doc:p>
duke@0 360 This specifies the content of a complexType element. As children, it can
duke@0 361 have a simpleContent, a complexContent or a model group. Only if it has
duke@0 362 one of the latter two, may it have a mixed attribute. This latter
duke@0 363 constraint is something that cannot be specified in XML Schema.
duke@0 364 </doc:p>
duke@0 365 <choice>
duke@0 366 <ref name="simpleContent" />
duke@0 367 <group>
duke@0 368 <optional>
duke@0 369 <attribute name="mixed">
duke@0 370 <data type="boolean" />
duke@0 371 </attribute>
duke@0 372 </optional>
duke@0 373 <choice>
duke@0 374 <ref name="complexContent" />
duke@0 375 <group>
duke@0 376 <optional>
duke@0 377 <ref name="typeDefParticle" />
duke@0 378 </optional>
duke@0 379 <ref name="attrDecls" />
duke@0 380 </group>
duke@0 381 </choice>
duke@0 382 </group>
duke@0 383 </choice>
duke@0 384 </define>
duke@0 385
duke@0 386 <define name="complexTypeHost" txw:mode="inherit">
duke@0 387 <ref name="typeHost" />
duke@0 388 <ref name="complexType" />
duke@0 389 </define>
duke@0 390
duke@0 391 <define name="typeHost" txw:mode="inherit"><empty/><empty/></define>
duke@0 392
duke@0 393 <define name="complexType" txw:mode="inherit">
duke@0 394 <element name="complexType"
duke@0 395 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexType">
duke@0 396 <doc:p>
duke@0 397 This specifies the basic content of a complexType element.
duke@0 398 </doc:p>
duke@0 399 <ref name="annotated" />
duke@0 400 <ref name="complexTypeModel" />
duke@0 401 <optional>
duke@0 402 <attribute name="name">
duke@0 403 <data type="NCName" />
duke@0 404 </attribute>
duke@0 405 </optional>
duke@0 406 <zeroOrMore>
duke@0 407 <choice>
duke@0 408 <attribute name="abstract">
duke@0 409 <data type="boolean" />
duke@0 410 </attribute>
duke@0 411 <attribute name="block">
duke@0 412 <ref name="derivationSet" />
duke@0 413 </attribute>
duke@0 414 <attribute name="final">
duke@0 415 <ref name="derivationSet" />
duke@0 416 </attribute>
duke@0 417 </choice>
duke@0 418 </zeroOrMore>
duke@0 419 </element>
duke@0 420 </define>
duke@0 421
duke@0 422 <define name="complexRestriction">
duke@0 423 <doc:p>
duke@0 424 This describes a restriction element within a complexContent element
duke@0 425 (i.e. one that restricts a complex type). It has a base attribute, may
duke@0 426 contain a model group and may contain attribute declarations of various
duke@0 427 sorts.
duke@0 428 </doc:p>
duke@0 429 <element name="restriction"
duke@0 430 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::restriction">
duke@0 431 <ref name="annotated" />
duke@0 432 <attribute name="base">
duke@0 433 <data type="QName" />
duke@0 434 </attribute>
duke@0 435 <optional>
duke@0 436 <ref name="typeDefParticle" />
duke@0 437 </optional>
duke@0 438 <ref name="attrDecls" />
duke@0 439 </element>
duke@0 440 </define>
duke@0 441
duke@0 442 <define name="extensionType">
duke@0 443 <doc:p>
duke@0 444 This specifies the basic model for an extension element: adding a
duke@0 445 required base attribute to the model used for most components.
duke@0 446 </doc:p>
duke@0 447 <ref name="annotated" />
duke@0 448 <attribute name="base">
duke@0 449 <data type="QName" />
duke@0 450 </attribute>
duke@0 451 </define>
duke@0 452
duke@0 453 <define name="complexExtension">
duke@0 454 <doc:p>
duke@0 455 This describes an extension element within a complexContent element
duke@0 456 (i.e. one that restricts a complex type). It may contain a model group
duke@0 457 and may contain attribute declarations of various sorts.
duke@0 458 </doc:p>
duke@0 459 <element name="extension"
duke@0 460 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::extension">
duke@0 461 <ref name="extensionType" />
duke@0 462 <optional>
duke@0 463 <ref name="typeDefParticle" />
duke@0 464 </optional>
duke@0 465 <ref name="attrDecls" />
duke@0 466 </element>
duke@0 467 </define>
duke@0 468
duke@0 469 <define name="complexContent">
duke@0 470 <doc:p>
duke@0 471 This describes a complexContent element. It may have a mixed attribute,
duke@0 472 and either a restriction or extension element as content.
duke@0 473 </doc:p>
duke@0 474 <element name="complexContent"
duke@0 475 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent">
duke@0 476 <ref name="annotated" />
duke@0 477 <optional>
duke@0 478 <attribute name="mixed">
duke@0 479 <data type="boolean" />
duke@0 480 </attribute>
duke@0 481 </optional>
duke@0 482 <choice>
duke@0 483 <ref name="complexRestriction" />
duke@0 484 <ref name="complexExtension" />
duke@0 485 </choice>
duke@0 486 </element>
duke@0 487 </define>
duke@0 488
duke@0 489 <define name="simpleRestriction">
duke@0 490 <doc:p>
duke@0 491 This describes a restriction element that appears within a simpleContent
duke@0 492 or simpleType element (i.e. one that restricts a simple type). Its
duke@0 493 content follows the simple restriction model that is detailed below, and
duke@0 494 may include attribute declarations.
duke@0 495 </doc:p>
duke@0 496 <element name="restriction"
duke@0 497 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::restriction">
duke@0 498 <ref name="annotated" />
duke@0 499 <ref name="simpleRestrictionModel" />
duke@0 500 <ref name="attrDecls" />
duke@0 501 </element>
duke@0 502 </define>
duke@0 503
duke@0 504 <define name="simpleExtension">
duke@0 505 <doc:p>
duke@0 506 This describes an extension element that appears within a simpleContent
duke@0 507 element (i.e. one that extends a simple type). Like other extensions, it
duke@0 508 has a base type, but it can only be used to add attributes.
duke@0 509 </doc:p>
duke@0 510 <element name="extension"
duke@0 511 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::extension">
duke@0 512 <ref name="extensionType" />
duke@0 513 <ref name="attrDecls" />
duke@0 514 </element>
duke@0 515 </define>
duke@0 516
duke@0 517 <define name="simpleContent">
duke@0 518 <doc:p>
duke@0 519 This describes a simpleContent element, whose content can either hold a
duke@0 520 restriction or extension element.
duke@0 521 </doc:p>
duke@0 522 <element name="simpleContent"
duke@0 523 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent">
duke@0 524 <ref name="annotated" />
duke@0 525 <choice>
duke@0 526 <ref name="simpleRestriction" />
duke@0 527 <ref name="simpleExtension" />
duke@0 528 </choice>
duke@0 529 </element>
duke@0 530 </define>
duke@0 531
duke@0 532 <define name="blockSet">
duke@0 533 <doc:p>
duke@0 534 This gives the possible values for block attributes on element elements,
duke@0 535 which includes substitution amongst the list of possible values. This
duke@0 536 RELAX NG schema, like the XML Schema Recommendation, allows each of the
duke@0 537 keywords 'extension', 'restriction' and 'substitution' to occur more than
duke@0 538 once within the list.
duke@0 539 </doc:p>
duke@0 540 <choice>
duke@0 541 <value type="token">#all</value>
duke@0 542 <list>
duke@0 543 <oneOrMore>
duke@0 544 <choice>
duke@0 545 <value>extension</value>
duke@0 546 <value>restriction</value>
duke@0 547 <value>substitution</value>
duke@0 548 </choice>
duke@0 549 </oneOrMore>
duke@0 550 </list>
duke@0 551 </choice>
duke@0 552 </define>
duke@0 553
duke@0 554 <define name="element" txw:mode="inherit">
duke@0 555 <doc:p>
duke@0 556 This describes the basic content model of an element element. It is
duke@0 557 annotated, may have a fixed or default attribute, and may have nillable
duke@0 558 and/or block attributes. Its type may be specified through a type
duke@0 559 attribute, a local simple type or a local complex type - the choice
duke@0 560 between these methods is something that cannot be indicated with XML
duke@0 561 Schema. This content is optionally followed by some identify constraints.
duke@0 562 </doc:p>
duke@0 563 <ref name="annotated" />
duke@0 564 <ref name="fixedOrDefault" />
duke@0 565 <zeroOrMore>
duke@0 566 <choice>
duke@0 567 <attribute name="nillable">
duke@0 568 <data type="boolean" />
duke@0 569 </attribute>
duke@0 570 <attribute name="block">
duke@0 571 <ref name="blockSet" />
duke@0 572 </attribute>
duke@0 573 </choice>
duke@0 574 </zeroOrMore>
duke@0 575 <choice>
duke@0 576 <empty />
duke@0 577 <attribute name="type">
duke@0 578 <data type="QName" />
duke@0 579 </attribute>
duke@0 580 <ref name="simpleTypeHost" />
duke@0 581 <ref name="complexTypeHost" />
duke@0 582 </choice>
duke@0 583 <!--zeroOrMore>
duke@0 584 <ref name="identityConstraint" />
duke@0 585 </zeroOrMore-->
duke@0 586 </define>
duke@0 587
duke@0 588 <define name="topLevelElement">
duke@0 589 <doc:p>
duke@0 590 This describes an element element that appears at the top level of the
duke@0 591 schema. On top of the basic content for an element element, it has to
duke@0 592 have a name, which is a unique identifier in the element symbol space. It
duke@0 593 may have substitutionGroup, abstract and/or final attributes.
duke@0 594 </doc:p>
duke@0 595 <element name="element"
duke@0 596 doc:href="http://www.w3.org/TR/xmlschema-1/#element-element">
duke@0 597 <ref name="element" />
duke@0 598 <attribute name="name">
duke@0 599 <data type="NCName" />
duke@0 600 </attribute>
duke@0 601 <zeroOrMore>
duke@0 602 <choice>
duke@0 603 <attribute name="substitutionGroup">
duke@0 604 <data type="QName" />
duke@0 605 </attribute>
duke@0 606 <attribute name="abstract">
duke@0 607 <data type="boolean" />
duke@0 608 </attribute>
duke@0 609 <attribute name="final">
duke@0 610 <ref name="derivationSet" />
duke@0 611 </attribute>
duke@0 612 </choice>
duke@0 613 </zeroOrMore>
duke@0 614 </element>
duke@0 615 </define>
duke@0 616
duke@0 617 <define name="localElement">
duke@0 618 <doc:p>
duke@0 619 This describes an element element that appears locally, within a
duke@0 620 complexType or group element. It may have minOccurs and/or maxOccurs
duke@0 621 attributes. If it has a ref attribute, then that&apos;s all it can
duke@0 622 have. Otherwise, it must have a name and specifies its type in the same
duke@0 623 way as the basic element content model described above. It may in this
duke@0 624 case also have a form element. These constraints on local elements
duke@0 625 cannot be described within XML Schema.
duke@0 626 </doc:p>
duke@0 627 <element name="element"
duke@0 628 doc:href="http://www.w3.org/TR/xmlschema-1/#element-element">
duke@0 629 <ref name="occurs" />
duke@0 630 <choice>
duke@0 631 <attribute name="ref">
duke@0 632 <data type="QName" />
duke@0 633 </attribute>
duke@0 634 <group>
duke@0 635 <ref name="element" />
duke@0 636 <attribute name="name">
duke@0 637 <data type="NCName" />
duke@0 638 </attribute>
duke@0 639 <optional>
duke@0 640 <attribute name="form">
duke@0 641 <ref name="formChoice" />
duke@0 642 </attribute>
duke@0 643 </optional>
duke@0 644 </group>
duke@0 645 </choice>
duke@0 646 </element>
duke@0 647 </define>
duke@0 648
duke@0 649 <!--define name="namedGroup">
duke@0 650 <doc:p>
duke@0 651 This describes an group element that appears at the top level of the
duke@0 652 schema. It must have a name attribute, and must have one of an all,
duke@0 653 choice or sequence element child.
duke@0 654 </doc:p>
duke@0 655 <element name="group"
duke@0 656 doc:href="http://www.w3.org/TR/xmlschema-1/#element-group">
duke@0 657 <ref name="annotated" />
duke@0 658 <attribute name="name">
duke@0 659 <data type="NCName" />
duke@0 660 </attribute>
duke@0 661 <choice>
duke@0 662 <element name="all">
duke@0 663 <ref name="simpleExplicitGroup" /> <!- - RS - relaxed all content model - ->
duke@0 664 </element>
duke@0 665 <element name="choice">
duke@0 666 <ref name="simpleExplicitGroup" />
duke@0 667 </element>
duke@0 668 <element name="sequence">
duke@0 669 <ref name="simpleExplicitGroup" />
duke@0 670 </element>
duke@0 671 </choice>
duke@0 672 </element>
duke@0 673 </define-->
duke@0 674
duke@0 675 <!--define name="groupRef">
duke@0 676 <doc:p>
duke@0 677 This describes group element that occurs locally, referring to a
duke@0 678 top-level named group. It may have occurrence attributes, and must have
duke@0 679 a ref attribute.
duke@0 680 </doc:p>
duke@0 681 <element name="group"
duke@0 682 doc:href="http://www.w3.org/TR/xmlschema-1/#element-group">
duke@0 683 <ref name="annotated" />
duke@0 684 <ref name="occurs" />
duke@0 685 <attribute name="ref">
duke@0 686 <data type="QName" />
duke@0 687 </attribute>
duke@0 688 </element>
duke@0 689 </define-->
duke@0 690
duke@0 691 <define name="explicitGroup" txw:mode="inherit">
duke@0 692 <doc:p>
duke@0 693 This gives the content of a model group (not a group element) in the
duke@0 694 normal run of things. It has occurrence attributes and any number of
duke@0 695 particles within it.
duke@0 696 </doc:p>
duke@0 697 <ref name="annotated" />
duke@0 698 <ref name="occurs" />
duke@0 699 <zeroOrMore>
duke@0 700 <ref name="nestedParticle" />
duke@0 701 </zeroOrMore>
duke@0 702 </define>
duke@0 703
duke@0 704 <define name="simpleExplicitGroup">
duke@0 705 <doc:p>
duke@0 706 This gives the content of a model group (not a group element) within a
duke@0 707 named group - it differs from the above in that it doesn&apos;t have any
duke@0 708 occurrence attributes.
duke@0 709 </doc:p>
duke@0 710 <ref name="annotated" />
duke@0 711 <zeroOrMore>
duke@0 712 <ref name="nestedParticle" />
duke@0 713 </zeroOrMore>
duke@0 714 </define>
duke@0 715
duke@0 716 <define name="all">
duke@0 717 <doc:p>
duke@0 718 This describes an all element that appears outside a named group (i.e. as
duke@0 719 the content of a complexType element). It has the standard model for an
duke@0 720 all element, but adds minOccurs and maxOccurs attributes which can only
duke@0 721 take certain values.
duke@0 722 </doc:p>
duke@0 723 <element name="all"
duke@0 724 doc:href="http://www.w3.org/TR/xmlschema-1/#element-all">
duke@0 725 <ref name="explicitGroup" />
duke@0 726 </element>
duke@0 727 </define>
duke@0 728
duke@0 729 <define name="choice">
duke@0 730 <doc:p>
duke@0 731 This describes a choice element that appears outside a named group.
duke@0 732 </doc:p>
duke@0 733 <element name="choice"
duke@0 734 doc:href="http://www.w3.org/TR/xmlschema-1/#element-choice">
duke@0 735 <ref name="explicitGroup" />
duke@0 736 </element>
duke@0 737 </define>
duke@0 738
duke@0 739 <define name="sequence">
duke@0 740 <doc:p>
duke@0 741 This describes a sequence element that appears outside a named group.
duke@0 742 </doc:p>
duke@0 743 <element name="sequence"
duke@0 744 doc:href="http://www.w3.org/TR/xmlschema-1/#element-sequence">
duke@0 745 <ref name="explicitGroup" />
duke@0 746 </element>
duke@0 747 </define>
duke@0 748
duke@0 749 <define name="wildcard" txw:mode="inherit">
duke@0 750 <doc:p>
duke@0 751 This describes a wildcard element (i.e. any or anyAttribute). The
duke@0 752 namespace attribute can take a list URIs interspersed with the keywords
duke@0 753 '##targetNamespace' and/or '##local'. This RELAX NG schema, like the XML
duke@0 754 Schema Recommendation, allows the keywords to be specified more than once
duke@0 755 each within the list, if they&apos;re given. This model also specifies the
duke@0 756 processContents attribute.
duke@0 757 </doc:p>
duke@0 758 <ref name="annotated" />
duke@0 759 <zeroOrMore>
duke@0 760 <choice>
duke@0 761 <attribute name="namespace">
duke@0 762 <choice>
duke@0 763 <value type="token">##any</value>
duke@0 764 <value type="token">##other</value>
duke@0 765 <list>
duke@0 766 <zeroOrMore>
duke@0 767 <choice>
duke@0 768 <data type="anyURI" />
duke@0 769 <value>##targetNamespace</value>
duke@0 770 <value>##local</value>
duke@0 771 </choice>
duke@0 772 </zeroOrMore>
duke@0 773 </list>
duke@0 774 </choice>
duke@0 775 </attribute>
duke@0 776 <attribute name="processContents">
duke@0 777 <choice>
duke@0 778 <value type="token">lax</value>
duke@0 779 <value type="token">skip</value>
duke@0 780 <value type="token">strict</value>
duke@0 781 </choice>
duke@0 782 </attribute>
duke@0 783 </choice>
duke@0 784 </zeroOrMore>
duke@0 785 </define>
duke@0 786
duke@0 787 <define name="any">
duke@0 788 <doc:p>
duke@0 789 This describes an any element as a wildcard.
duke@0 790 </doc:p>
duke@0 791 <element name="any"
duke@0 792 doc:href="http://www.w3.org/TR/xmlschema-1/#element-any">
duke@0 793 <ref name="wildcard" />
duke@0 794 <ref name="occurs" />
duke@0 795 </element>
duke@0 796 </define>
duke@0 797
duke@0 798 <!--define name="namedAttributeGroup">
duke@0 799 <doc:p>
duke@0 800 This describes an attributeGroup element as it appears at the top level
duke@0 801 of the schema. It must have a name attribute, and then contains
duke@0 802 attribute declarations.
duke@0 803 </doc:p>
duke@0 804 <element name="attributeGroup"
duke@0 805 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup">
duke@0 806 <ref name="annotated" />
duke@0 807 <attribute name="name">
duke@0 808 <data type="NCName" />
duke@0 809 </attribute>
duke@0 810 <ref name="attrDecls" />
duke@0 811 </element>
duke@0 812 </define-->
duke@0 813
duke@0 814 <!--define name="attributeGroupRef">
duke@0 815 <doc:p>
duke@0 816 This describes an attributeGroup element as it appears within a complex
duke@0 817 type. It must have a ref attribute.
duke@0 818 </doc:p>
duke@0 819 <element name="attributeGroup"
duke@0 820 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup">
duke@0 821 <ref name="annotated" />
duke@0 822 <attribute name="ref">
duke@0 823 <data type="QName" />
duke@0 824 </attribute>
duke@0 825 </element>
duke@0 826 </define-->
duke@0 827
duke@0 828 <!--define name="include">
duke@0 829 <doc:p>
duke@0 830 This describes an include element, which must have a schemaLocation
duke@0 831 attribute.
duke@0 832 </doc:p>
duke@0 833 <element name="include"
duke@0 834 doc:href="http://www.w3.org/TR/xmlschema-1/#element-include">
duke@0 835 <ref name="annotated" />
duke@0 836 <attribute name="schemaLocation">
duke@0 837 <data type="anyURI" />
duke@0 838 </attribute>
duke@0 839 </element>
duke@0 840 </define-->
duke@0 841
duke@0 842 <!--define name="redefine">
duke@0 843 <doc:p>
duke@0 844 This describes a redefine element, which must have a schemaLocation
duke@0 845 attribute and can then contain any mix of annotations and redefinable
duke@0 846 components.
duke@0 847 </doc:p>
duke@0 848 <element name="redefine"
duke@0 849 doc:href="http://www.w3.org/TR/xmlschema-1/#element-redefine">
duke@0 850 <ref name="openAttrs" />
duke@0 851 <optional>
duke@0 852 <attribute name="id">
duke@0 853 <data type="ID" />
duke@0 854 </attribute>
duke@0 855 </optional>
duke@0 856 <attribute name="schemaLocation">
duke@0 857 <data type="anyURI" />
duke@0 858 </attribute>
duke@0 859 <zeroOrMore>
duke@0 860 <choice>
duke@0 861 <ref name="annotation" />
duke@0 862 <ref name="redefinable" />
duke@0 863 </choice>
duke@0 864 </zeroOrMore>
duke@0 865 </element>
duke@0 866 </define-->
duke@0 867
duke@0 868 <define name="import">
duke@0 869 <doc:p>
duke@0 870 This describes an import element that&apos;s used when its parent schema
duke@0 871 element specifies a targetNamespace. In these cases, the namespace
duke@0 872 attribute on the import element is optional.
duke@0 873 </doc:p>
duke@0 874 <element name="import"
duke@0 875 doc:href="http://www.w3.org/TR/xmlschema-1/#element-import">
duke@0 876 <ref name="annotated" />
duke@0 877 <optional>
duke@0 878 <attribute name="schemaLocation">
duke@0 879 <data type="anyURI" />
duke@0 880 </attribute>
duke@0 881 </optional>
duke@0 882 <optional>
duke@0 883 <attribute name="namespace">
duke@0 884 <data type="anyURI" />
duke@0 885 </attribute>
duke@0 886 </optional>
duke@0 887 </element>
duke@0 888 </define>
duke@0 889
duke@0 890 <!--define name="selector">
duke@0 891 <doc:p>
duke@0 892 This describes a selector element. The xpath attribute is a simplified
duke@0 893 XPath - the regular expression given here is the one from the XML Schema
duke@0 894 for XML Schema.
duke@0 895 </doc:p>
duke@0 896 <element name="selector"
duke@0 897 doc:href="http://www.w3.org/TR/xmlschema-1/#element-selector">
duke@0 898 <ref name="annotated" />
duke@0 899 <attribute name="xpath">
duke@0 900 <data type="token">
duke@0 901 <param name="pattern">(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*</param>
duke@0 902 </data>
duke@0 903 </attribute>
duke@0 904 </element>
duke@0 905 </define>
duke@0 906
duke@0 907 <define name="field">
duke@0 908 <doc:p>
duke@0 909 This describes a field element. The xpath attribute is a simplified
duke@0 910 XPath - the regular expression given here is the one from the XML Schema
duke@0 911 for XML Schema.
duke@0 912 </doc:p>
duke@0 913 <element name="field"
duke@0 914 doc:href="http://www.w3.org/TR/xmlschema-1/#element-field">
duke@0 915 <ref name="annotated" />
duke@0 916 <attribute name="xpath">
duke@0 917 <data type="token">
duke@0 918 <param name="pattern">(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*</param>
duke@0 919 </data>
duke@0 920 </attribute>
duke@0 921 </element>
duke@0 922 </define>
duke@0 923
duke@0 924 <define name="keybase" txw:mode="inherit">
duke@0 925 <doc:p>
duke@0 926 This gives the basic content for identity constraints - a name attribute
duke@0 927 that uniquely identifies the identity constraint, a selector element and
duke@0 928 one or more field elements.
duke@0 929 </doc:p>
duke@0 930 <ref name="annotated" />
duke@0 931 <attribute name="name">
duke@0 932 <data type="NCName" />
duke@0 933 </attribute>
duke@0 934 <ref name="selector" />
duke@0 935 <oneOrMore>
duke@0 936 <ref name="field" />
duke@0 937 </oneOrMore>
duke@0 938 </define>
duke@0 939
duke@0 940 <define name="identityConstraint" txw:mode="inline">
duke@0 941 <doc:p>
duke@0 942 This gives a model group for the three identity constraint elements, used
duke@0 943 within the content of element elements.
duke@0 944 </doc:p>
duke@0 945 <choice>
duke@0 946 <ref name="unique" />
duke@0 947 <ref name="key" />
duke@0 948 <ref name="keyref" />
duke@0 949 </choice>
duke@0 950 </define>
duke@0 951
duke@0 952 <define name="unique">
duke@0 953 <doc:p>
duke@0 954 This describes a unique element.
duke@0 955 </doc:p>
duke@0 956 <element name="unique"
duke@0 957 doc:href="http://www.w3.org/TR/xmlschema-1/#element-unique">
duke@0 958 <ref name="keybase" />
duke@0 959 </element>
duke@0 960 </define>
duke@0 961
duke@0 962 <define name="key">
duke@0 963 <doc:p>
duke@0 964 This describes a key element.
duke@0 965 </doc:p>
duke@0 966 <element name="key"
duke@0 967 doc:href="http://www.w3.org/TR/xmlschema-1/#element-key">
duke@0 968 <ref name="keybase" />
duke@0 969 </element>
duke@0 970 </define>
duke@0 971
duke@0 972 <define name="keyref">
duke@0 973 <doc:p>
duke@0 974 This describes a keyref element.
duke@0 975 </doc:p>
duke@0 976 <element name="keyref"
duke@0 977 doc:href="http://www.w3.org/TR/xmlschema-1/#element-keyref">
duke@0 978 <ref name="keybase" />
duke@0 979 <attribute name="refer">
duke@0 980 <data type="QName" />
duke@0 981 </attribute>
duke@0 982 </element>
duke@0 983 </define-->
duke@0 984
duke@0 985 <!--define name="notation">
duke@0 986 <doc:p>
duke@0 987 This describes a notation element. The names of notation elements are
duke@0 988 unique in the notation symbol space. The public attribute is required,
duke@0 989 and the system attribute is optional.
duke@0 990 </doc:p>
duke@0 991 <element name="notation"
duke@0 992 doc:href="http://www.w3.org/TR/xmlschema-1/#element-notation">
duke@0 993 <ref name="annotated" />
duke@0 994 <attribute name="name">
duke@0 995 <data type="NCName" />
duke@0 996 </attribute>
duke@0 997 <attribute name="public">
duke@0 998 <data type="token" />
duke@0 999 </attribute>
duke@0 1000 <optional>
duke@0 1001 <attribute name="system">
duke@0 1002 <data type="anyURI" />
duke@0 1003 </attribute>
duke@0 1004 </optional>
duke@0 1005 </element>
duke@0 1006 </define-->
duke@0 1007
duke@0 1008 <define name="appinfoContent">
duke@0 1009 <doc:p>
duke@0 1010 This is designed to describe the content of the appinfo elements in the
duke@0 1011 schema. At the moment this allows any mixed content without validation.
duke@0 1012 Note that this is fairly complex compared to the XML Schema equivalent,
duke@0 1013 which would be a single any element.
duke@0 1014 </doc:p>
duke@0 1015 <ref name="anyContent" />
duke@0 1016 </define>
duke@0 1017
duke@0 1018 <define name="anyContent">
duke@0 1019 <empty/> <!-- KK don't care -->
duke@0 1020 <!--mixed>
duke@0 1021 <zeroOrMore>
duke@0 1022 <element>
duke@0 1023 <anyName />
duke@0 1024 <zeroOrMore>
duke@0 1025 <attribute>
duke@0 1026 <anyName />
duke@0 1027 </attribute>
duke@0 1028 </zeroOrMore>
duke@0 1029 <ref name="anyContent" />
duke@0 1030 <empty />
duke@0 1031 </element>
duke@0 1032 </zeroOrMore>
duke@0 1033 </mixed-->
duke@0 1034 </define>
duke@0 1035
duke@0 1036 <define name="appinfo">
duke@0 1037 <doc:p>
duke@0 1038 This describes an appinfo element. It has an optional source attribute
duke@0 1039 and can currently contain anything at all.
duke@0 1040 </doc:p>
duke@0 1041 <element name="appinfo"
duke@0 1042 doc:href="http://www.w3.org/TR/xmlschema-1/#element-appinfo">
duke@0 1043 <optional>
duke@0 1044 <attribute name="source">
duke@0 1045 <data type="anyURI" />
duke@0 1046 </attribute>
duke@0 1047 </optional>
duke@0 1048 <ref name="appinfoContent" />
duke@0 1049 </element>
duke@0 1050 </define>
duke@0 1051
duke@0 1052 <define name="documentationContent">
duke@0 1053 <doc:p>
duke@0 1054 This is designed to describe the content of the documentation elements in
duke@0 1055 the schema. At the moment this allows any mixed content without
duke@0 1056 validation. Note that this is fairly complex compared to the XML Schema
duke@0 1057 equivalent, which would be a single any element.
duke@0 1058 </doc:p>
duke@0 1059 <ref name="anyContent" />
duke@0 1060 </define>
duke@0 1061
duke@0 1062 <define name="documentation">
duke@0 1063 <doc:p>
duke@0 1064 This describes a documentation element. It has optional source
duke@0 1065 and xml:lang attributes and can currently contain anything at all.
duke@0 1066 </doc:p>
duke@0 1067 <element name="documentation"
duke@0 1068 doc:href="http://www.w3.org/TR/xmlschema-1/#element-documentation">
duke@0 1069 <zeroOrMore>
duke@0 1070 <choice>
duke@0 1071 <attribute name="source">
duke@0 1072 <data type="anyURI" />
duke@0 1073 </attribute>
duke@0 1074 <attribute name="xml:lang">
duke@0 1075 <data type="language" />
duke@0 1076 </attribute>
duke@0 1077 </choice>
duke@0 1078 </zeroOrMore>
duke@0 1079 <ref name="documentationContent" />
duke@0 1080 </element>
duke@0 1081 </define>
duke@0 1082
duke@0 1083 <define name="annotation">
duke@0 1084 <doc:p>
duke@0 1085 This describes an annotation element. It can have any attributes, may
duke@0 1086 have an id attribute, and contains any number of documentation or appinfo
duke@0 1087 elements.
duke@0 1088 </doc:p>
duke@0 1089 <element name="annotation"
duke@0 1090 doc:href="http://www.w3.org/TR/xmlschema-1/#element-annotation">
duke@0 1091 <ref name="openAttrs" />
duke@0 1092 <optional>
duke@0 1093 <attribute name="id">
duke@0 1094 <data type="ID" />
duke@0 1095 </attribute>
duke@0 1096 </optional>
duke@0 1097 <zeroOrMore>
duke@0 1098 <choice>
duke@0 1099 <ref name="documentation" />
duke@0 1100 <ref name="appinfo" />
duke@0 1101 </choice>
duke@0 1102 </zeroOrMore>
duke@0 1103 </element>
duke@0 1104 </define>
duke@0 1105
duke@0 1106 <define name="simpleDerivation" txw:mode="inline">
duke@0 1107 <doc:p>
duke@0 1108 This gives the various types of derivation of simple types.
duke@0 1109 </doc:p>
duke@0 1110 <choice>
duke@0 1111 <ref name="simpleRestriction" />
duke@0 1112 <ref name="list" />
duke@0 1113 <ref name="union" />
duke@0 1114 </choice>
duke@0 1115 </define>
duke@0 1116
duke@0 1117 <define name="simpleDerivationSet">
duke@0 1118 <doc:p>
duke@0 1119 This specifies the values of the final attribute for simple types. This
duke@0 1120 RELAX NG schema for XML Schema, like the XML Schema Recommendation, allows
duke@0 1121 the keywords 'list', 'union' and 'restriction' to appear more than once
duke@0 1122 within the list.
duke@0 1123 </doc:p>
duke@0 1124 <choice>
duke@0 1125 <value type="token">#all</value>
duke@0 1126 <list>
duke@0 1127 <zeroOrMore>
duke@0 1128 <choice>
duke@0 1129 <value>list</value>
duke@0 1130 <value>union</value>
duke@0 1131 <value>restriction</value>
duke@0 1132 </choice>
duke@0 1133 </zeroOrMore>
duke@0 1134 </list>
duke@0 1135 </choice>
duke@0 1136 </define>
duke@0 1137
duke@0 1138 <define name="simpleTypeHost" txw:mode="inherit">
duke@0 1139 <ref name="typeHost" />
duke@0 1140 <ref name="simpleType" />
duke@0 1141 </define>
duke@0 1142
duke@0 1143 <define name="simpleType" txw:mode="inherit">
duke@0 1144 <doc:p>
duke@0 1145 This gives the basic content of a simple type.
duke@0 1146 </doc:p>
duke@0 1147 <element name="simpleType"
duke@0 1148 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType">
duke@0 1149 <ref name="annotated" />
duke@0 1150 <ref name="simpleDerivation" />
duke@0 1151 <optional>
duke@0 1152 <attribute name="name">
duke@0 1153 <data type="NCName" />
duke@0 1154 </attribute>
duke@0 1155 </optional>
duke@0 1156 <optional>
duke@0 1157 <attribute name="final">
duke@0 1158 <ref name="simpleDerivationSet" />
duke@0 1159 </attribute>
duke@0 1160 </optional>
duke@0 1161 </element>
duke@0 1162 </define>
duke@0 1163
duke@0 1164 <!--define name="rangeFacets" txw:mode="inherit">
duke@0 1165 <doc:p>
duke@0 1166 This describes the relationship between the various range facets. Only
duke@0 1167 one of minExclusive and minInclusive can be present, and only one of
duke@0 1168 maxExclusive and maxInclusive can be present. This is a constraint that
duke@0 1169 can&apos;t easily be expressed using XML Schema. This RELAX NG schema
duke@0 1170 for XML Schema is a little more restrictive than the XML Schema
duke@0 1171 Recommendation in that it also forces there to be a maximum of one of
duke@0 1172 each of these types of facets.
duke@0 1173 </doc:p>
duke@0 1174 <interleave>
duke@0 1175 <optional>
duke@0 1176 <choice>
duke@0 1177 <ref name="minExclusive" />
duke@0 1178 <ref name="minInclusive" />
duke@0 1179 </choice>
duke@0 1180 </optional>
duke@0 1181 <optional>
duke@0 1182 <choice>
duke@0 1183 <ref name="maxExclusive" />
duke@0 1184 <ref name="maxInclusive" />
duke@0 1185 </choice>
duke@0 1186 </optional>
duke@0 1187 </interleave>
duke@0 1188 </define>
duke@0 1189
duke@0 1190 <define name="digitFacets" txw:mode="inherit">
duke@0 1191 <doc:p>
duke@0 1192 This specifies optional totalDigits and fractionDigits elements. This
duke@0 1193 RELAX NG schema for XML Schema is a little more restrictive than the XML
duke@0 1194 Schema Recommendation in that it also forces there to be a maximum of one
duke@0 1195 of each of these types of facets.
duke@0 1196 </doc:p>
duke@0 1197 <optional>
duke@0 1198 <ref name="totalDigits" />
duke@0 1199 </optional>
duke@0 1200 <optional>
duke@0 1201 <ref name="fractionDigits" />
duke@0 1202 </optional>
duke@0 1203 </define>
duke@0 1204
duke@0 1205 <define name="lengthFacets" txw:mode="inherit">
duke@0 1206 <doc:p>
duke@0 1207 This specifies optional length, minLength and maxLength elements. This
duke@0 1208 RELAX NG schema for XML Schema is a little more restrictive than the XML
duke@0 1209 Schema Recommendation in that it also forces there to be a maximum of one
duke@0 1210 of each of these types of facets, and says that if a length element is
duke@0 1211 given, then neither minLength nor maxLength should be present.
duke@0 1212 </doc:p>
duke@0 1213 <choice>
duke@0 1214 <ref name="length" />
duke@0 1215 <interleave>
duke@0 1216 <optional>
duke@0 1217 <ref name="minLength" />
duke@0 1218 </optional>
duke@0 1219 <optional>
duke@0 1220 <ref name="maxLength" />
duke@0 1221 </optional>
duke@0 1222 </interleave>
duke@0 1223 </choice>
duke@0 1224 </define>
duke@0 1225
duke@0 1226 <define name="commonFacets" txw:mode="inherit">
duke@0 1227 <doc:p>
duke@0 1228 This specifies zero or more enumeration or pattern elements and an
duke@0 1229 optional whiteSpace element. This RELAX NG schema for XML Schema is a
duke@0 1230 little more restrictive than the XML Schema Recommendation in that it
duke@0 1231 also forces there to be a maximum of one whiteSpace element within the
duke@0 1232 facets. Note that the whiteSpace facet is constrained to have a value of
duke@0 1233 'collapse'.
duke@0 1234 </doc:p>
duke@0 1235 <zeroOrMore>
duke@0 1236 <ref name="enumeration" />
duke@0 1237 </zeroOrMore>
duke@0 1238 <optional>
duke@0 1239 <ref name="whiteSpaceCollapse" />
duke@0 1240 </optional>
duke@0 1241 <zeroOrMore>
duke@0 1242 <ref name="pattern" />
duke@0 1243 </zeroOrMore>
duke@0 1244 </define-->
duke@0 1245
duke@0 1246 <define name="simpleRestrictionModel">
duke@0 1247 <doc:p>
duke@0 1248 This specifies the types of facets that are valid in restrictions on the
duke@0 1249 built-in data types. This can only perform rudimentary checking, but
duke@0 1250 should be enough in most circumstances. Note that for xs:anySimpleType
duke@0 1251 and xs:string, the whiteSpace facet can take any value, for
duke@0 1252 xs:normalizedString it can be 'replace' or 'collapse', and for all other
duke@0 1253 built-in types it has to be 'collapse'.
duke@0 1254 </doc:p>
duke@0 1255 <choice>
duke@0 1256 <attribute name="base">
duke@0 1257 <data type="QName" />
duke@0 1258 </attribute>
duke@0 1259 <ref name="simpleTypeHost" />
duke@0 1260 </choice>
duke@0 1261 <interleave>
duke@0 1262 <!--ref name="rangeFacets" />
duke@0 1263 <ref name="digitFacets" />
duke@0 1264 <ref name="lengthFacets" />
duke@0 1265 <optional>
duke@0 1266 <ref name="whiteSpace" />
duke@0 1267 </optional-->
duke@0 1268 <zeroOrMore>
duke@0 1269 <ref name="enumeration" />
duke@0 1270 </zeroOrMore>
duke@0 1271 <!--zeroOrMore>
duke@0 1272 <ref name="pattern" />
duke@0 1273 </zeroOrMore-->
duke@0 1274 </interleave>
duke@0 1275 </define>
duke@0 1276
duke@0 1277 <define name="list">
duke@0 1278 <doc:p>
duke@0 1279 This describes a list element. It can either specify a local simple type
duke@0 1280 or have a itemType attribute. This constraint cannot be expressed in XML
duke@0 1281 Schema.
duke@0 1282 </doc:p>
duke@0 1283 <element name="list"
duke@0 1284 doc:href="http://www.w3.org/TR/xmlschema-1/#element-list">
duke@0 1285 <ref name="annotated" />
duke@0 1286 <choice>
duke@0 1287 <ref name="simpleTypeHost" />
duke@0 1288 <attribute name="itemType">
duke@0 1289 <data type="QName" />
duke@0 1290 </attribute>
duke@0 1291 </choice>
duke@0 1292 </element>
duke@0 1293 </define>
duke@0 1294
duke@0 1295 <define name="union">
duke@0 1296 <doc:p>
duke@0 1297 This describes a union element. If the memberTypes attribute is missing
duke@0 1298 or empty, then it must contain one or more simpleType elements; if
duke@0 1299 it&apos;s present, then it can contain simpleType elements or list simple
duke@0 1300 types in the memberTypes attribute. This constraint cannot be expressed
duke@0 1301 in XML Schema.
duke@0 1302 </doc:p>
duke@0 1303 <element name="union"
duke@0 1304 doc:href="http://www.w3.org/TR/xmlschema-1/#element-union">
duke@0 1305 <ref name="annotated" />
duke@0 1306 <choice>
duke@0 1307 <group>
duke@0 1308 <attribute name="memberTypes">
duke@0 1309 <list>
duke@0 1310 <oneOrMore>
duke@0 1311 <data type="QName" />
duke@0 1312 </oneOrMore>
duke@0 1313 </list>
duke@0 1314 </attribute>
duke@0 1315 <zeroOrMore>
duke@0 1316 <ref name="simpleTypeHost" />
duke@0 1317 </zeroOrMore>
duke@0 1318 </group>
duke@0 1319 <group>
duke@0 1320 <optional>
duke@0 1321 <attribute name="memberTypes">
duke@0 1322 <empty />
duke@0 1323 </attribute>
duke@0 1324 </optional>
duke@0 1325 <oneOrMore>
duke@0 1326 <ref name="simpleTypeHost" />
duke@0 1327 </oneOrMore>
duke@0 1328 </group>
duke@0 1329 </choice>
duke@0 1330 </element>
duke@0 1331 </define>
duke@0 1332
duke@0 1333 <define name="facet" txw:mode="inherit">
duke@0 1334 <doc:p>
duke@0 1335 This is the basic content of a facet. It has an optional fixed attribute.
duke@0 1336 </doc:p>
duke@0 1337 <ref name="annotated" />
duke@0 1338 <optional>
duke@0 1339 <attribute name="fixed">
duke@0 1340 <data type="boolean" />
duke@0 1341 </attribute>
duke@0 1342 </optional>
duke@0 1343 </define>
duke@0 1344
duke@0 1345 <define name="noFixedFacet" txw:mode="inherit">
duke@0 1346 <doc:p>
duke@0 1347 This is the content of a facet that cannot be fixed (enumeration or
duke@0 1348 pattern). It has a value attribute that can take any kind of value.
duke@0 1349 </doc:p>
duke@0 1350 <ref name="annotated" />
duke@0 1351 <attribute name="value" />
duke@0 1352 </define>
duke@0 1353
duke@0 1354 <!--define name="rangeFacet">
duke@0 1355 <doc:p>
duke@0 1356 This is the content of a range facet. The value must be one of the data
duke@0 1357 types shown (as these are the only types of data that accept ranges). I
duke@0 1358 haven&apos;t gone so far as to indicate the data type of the value
duke@0 1359 attribute of a range facet according to the base type as this would be
duke@0 1360 very complicated (although it would be possible in RELAX NG).
duke@0 1361 </doc:p>
duke@0 1362 <ref name="facet" />
duke@0 1363 <attribute name="value">
duke@0 1364 <choice>
duke@0 1365 <data type="decimal" />
duke@0 1366 <data type="float" />
duke@0 1367 <data type="double" />
duke@0 1368 <data type="duration" />
duke@0 1369 <data type="dateTime" />
duke@0 1370 <data type="time" />
duke@0 1371 <data type="date" />
duke@0 1372 <data type="gYearMonth" />
duke@0 1373 <data type="gYear" />
duke@0 1374 <data type="gMonthDay" />
duke@0 1375 <data type="gMonth" />
duke@0 1376 <data type="gDay" />
duke@0 1377 </choice>
duke@0 1378 </attribute>
duke@0 1379 </define>
duke@0 1380
duke@0 1381 <define name="minExclusive">
duke@0 1382 <doc:p>
duke@0 1383 This describes a minExclusive element.
duke@0 1384 </doc:p>
duke@0 1385 <element name="minExclusive"
duke@0 1386 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minExclusive">
duke@0 1387 <ref name="rangeFacet" />
duke@0 1388 </element>
duke@0 1389 </define>
duke@0 1390
duke@0 1391 <define name="minInclusive">
duke@0 1392 <doc:p>
duke@0 1393 This describes a minInclusive element.
duke@0 1394 </doc:p>
duke@0 1395 <element name="minInclusive"
duke@0 1396 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minInclusive">
duke@0 1397 <ref name="rangeFacet" />
duke@0 1398 </element>
duke@0 1399 </define>
duke@0 1400
duke@0 1401 <define name="maxExclusive">
duke@0 1402 <doc:p>
duke@0 1403 This describes a maxExclusive element.
duke@0 1404 </doc:p>
duke@0 1405 <element name="maxExclusive"
duke@0 1406 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxExclusive">
duke@0 1407 <ref name="rangeFacet" />
duke@0 1408 </element>
duke@0 1409 </define>
duke@0 1410
duke@0 1411 <define name="maxInclusive">
duke@0 1412 <doc:p>
duke@0 1413 This describes a maxInclusive element.
duke@0 1414 </doc:p>
duke@0 1415 <element name="maxInclusive"
duke@0 1416 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxInclusive">
duke@0 1417 <ref name="rangeFacet" />
duke@0 1418 </element>
duke@0 1419 </define>
duke@0 1420
duke@0 1421 <define name="numFacet">
duke@0 1422 <doc:p>
duke@0 1423 This is the content of a numerical facet.
duke@0 1424 </doc:p>
duke@0 1425 <ref name="facet" />
duke@0 1426 <attribute name="value">
duke@0 1427 <data type="nonNegativeInteger" />
duke@0 1428 </attribute>
duke@0 1429 </define>
duke@0 1430
duke@0 1431 <define name="totalDigits">
duke@0 1432 <doc:p>
duke@0 1433 This describes a totalDigits element. The value attribute must take a
duke@0 1434 positive integer.
duke@0 1435 </doc:p>
duke@0 1436 <element name="totalDigits"
duke@0 1437 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-totalDigits">
duke@0 1438 <ref name="facet" />
duke@0 1439 <attribute name="value">
duke@0 1440 <data type="positiveInteger" />
duke@0 1441 </attribute>
duke@0 1442 </element>
duke@0 1443 </define>
duke@0 1444
duke@0 1445 <define name="fractionDigits">
duke@0 1446 <doc:p>
duke@0 1447 This describes a fractionDigits element.
duke@0 1448 </doc:p>
duke@0 1449 <element name="fractionDigits"
duke@0 1450 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-fractionDigits">
duke@0 1451 <ref name="numFacet" />
duke@0 1452 </element>
duke@0 1453 </define>
duke@0 1454
duke@0 1455 <define name="length">
duke@0 1456 <doc:p>
duke@0 1457 This describes a length element.
duke@0 1458 </doc:p>
duke@0 1459 <element name="length"
duke@0 1460 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-length">
duke@0 1461 <ref name="numFacet" />
duke@0 1462 </element>
duke@0 1463 </define>
duke@0 1464
duke@0 1465 <define name="minLength">
duke@0 1466 <doc:p>
duke@0 1467 This describes a minLength element.
duke@0 1468 </doc:p>
duke@0 1469 <element name="minLength"
duke@0 1470 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minLength">
duke@0 1471 <ref name="numFacet" />
duke@0 1472 </element>
duke@0 1473 </define>
duke@0 1474
duke@0 1475 <define name="maxLength">
duke@0 1476 <doc:p>
duke@0 1477 This describes a maxLength element.
duke@0 1478 </doc:p>
duke@0 1479 <element name="maxLength"
duke@0 1480 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxLength">
duke@0 1481 <ref name="numFacet" />
duke@0 1482 </element>
duke@0 1483 </define-->
duke@0 1484
duke@0 1485 <define name="enumeration">
duke@0 1486 <doc:p>
duke@0 1487 This describes an enumeration element.
duke@0 1488 </doc:p>
duke@0 1489 <element name="enumeration"
duke@0 1490 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-enumeration">
duke@0 1491 <ref name="noFixedFacet" />
duke@0 1492 </element>
duke@0 1493 </define>
duke@0 1494
duke@0 1495 <!--define name="whiteSpace">
duke@0 1496 <doc:p>
duke@0 1497 This describes a whiteSpace element that can take any of the permitted
duke@0 1498 values.
duke@0 1499 </doc:p>
duke@0 1500 <element name="whiteSpace"
duke@0 1501 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
duke@0 1502 <ref name="facet" />
duke@0 1503 <attribute name="value">
duke@0 1504 <choice>
duke@0 1505 <value type="token">preserve</value>
duke@0 1506 <value type="token">replace</value>
duke@0 1507 <value type="token">collapse</value>
duke@0 1508 </choice>
duke@0 1509 </attribute>
duke@0 1510 </element>
duke@0 1511 </define>
duke@0 1512
duke@0 1513 <define name="whiteSpaceReplaceOrCollapse">
duke@0 1514 <doc:p>
duke@0 1515 This describes a whiteSpace element that can only take the values
duke@0 1516 'replace' or 'collapse'.
duke@0 1517 </doc:p>
duke@0 1518 <element name="whiteSpace"
duke@0 1519 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
duke@0 1520 <ref name="facet" />
duke@0 1521 <attribute name="value">
duke@0 1522 <choice>
duke@0 1523 <value type="token">replace</value>
duke@0 1524 <value type="token">collapse</value>
duke@0 1525 </choice>
duke@0 1526 </attribute>
duke@0 1527 </element>
duke@0 1528 </define>
duke@0 1529
duke@0 1530 <define name="whiteSpaceCollapse">
duke@0 1531 <doc:p>
duke@0 1532 This describes a whiteSpace element that can only take the value
duke@0 1533 'collapse'.
duke@0 1534 </doc:p>
duke@0 1535 <element name="whiteSpace"
duke@0 1536 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
duke@0 1537 <ref name="facet" />
duke@0 1538 <attribute name="value">
duke@0 1539 <value type="token">collapse</value>
duke@0 1540 </attribute>
duke@0 1541 </element>
duke@0 1542 </define>
duke@0 1543
duke@0 1544 <define name="pattern">
duke@0 1545 <doc:p>
duke@0 1546 This describes a pattern element.
duke@0 1547 </doc:p>
duke@0 1548 <element name="pattern"
duke@0 1549 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-pattern">
duke@0 1550 <ref name="noFixedFacet" />
duke@0 1551 </element>
duke@0 1552 </define-->
duke@0 1553
duke@0 1554 </grammar>