home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 January / PCWorld_2001-01_cd.bin / Software / Topware / xmlspy / xmlspy35.exe / Main / XMLSchema.dtd < prev    next >
Encoding:
Extensible Markup Language  |  2000-11-20  |  15.4 KB  |  396 lines

  1. <!-- DTD for XML Schemas: Part 1: Structures
  2.      Public Identifier: "-//W3C//DTD XMLSCHEMA 200010//EN"
  3.      Official Location: http://www.w3.org/2000/10/XMLSchema.dtd -->
  4. <!-- $Id: XMLSchema.dtd,v 1.20 2000/10/23 08:58:08 ht Exp $ -->
  5. <!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
  6. <!-- prose copy in the structures REC is the definitive version -->    <!--d-->
  7. <!-- (which shouldn't differ from this one except for this -->         <!--d-->
  8. <!-- comment and entity expansions, but just in case) -->              <!--d-->
  9. <!-- With the exception of cases with multiple namespace
  10.      prefixes for the XML Schema namespace, any XML document which is
  11.      not valid per this DTD given redefinitions in its internal subset of the
  12.      'p' and 's' parameter entities below appropriate to its namespace
  13.      declaration of the XML Schema namespace is almost certainly not
  14.      a valid schema. -->
  15.  
  16. <!-- The simpleType element and its constituent parts
  17.      are defined in XML Schema: Part 2: Datatypes -->
  18. <!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
  19.  
  20. <!ENTITY % p ''> <!-- can be overriden in the internal subset of a
  21.                       schema document to establish a namespace prefix -->
  22. <!ENTITY % s ''> <!-- if %p is defined (e.g. as foo:) then you must
  23.                       also define %s as the suffix for the appropriate
  24.                       namespace declaration (e.g. :foo) -->
  25. <!ENTITY % nds 'xmlns%s;'>
  26.  
  27. <!-- Define all the element names, with optional prefix -->
  28. <!ENTITY % schema "%p;schema">
  29. <!ENTITY % complexType "%p;complexType">
  30. <!ENTITY % complexContent "%p;complexContent">
  31. <!ENTITY % simpleContent "%p;simpleContent">
  32. <!ENTITY % extension "%p;extension">
  33. <!ENTITY % element "%p;element">
  34. <!ENTITY % unique "%p;unique">
  35. <!ENTITY % key "%p;key">
  36. <!ENTITY % keyref "%p;keyref">
  37. <!ENTITY % selector "%p;selector">
  38. <!ENTITY % field "%p;field">
  39. <!ENTITY % group "%p;group">
  40. <!ENTITY % all "%p;all">
  41. <!ENTITY % choice "%p;choice">
  42. <!ENTITY % sequence "%p;sequence">
  43. <!ENTITY % any "%p;any">
  44. <!ENTITY % anyAttribute "%p;anyAttribute">
  45. <!ENTITY % attribute "%p;attribute">
  46. <!ENTITY % attributeGroup "%p;attributeGroup">
  47. <!ENTITY % include "%p;include">
  48. <!ENTITY % import "%p;import">
  49. <!ENTITY % redefine "%p;redefine">
  50. <!ENTITY % notation "%p;notation">
  51.  
  52. <!-- annotation elements -->
  53. <!ENTITY % annotation "%p;annotation">
  54. <!ENTITY % appinfo "%p;appinfo">
  55. <!ENTITY % documentation "%p;documentation">
  56.  
  57. <!-- Customisation entities for the ATTLIST of each element type.
  58.      Define one of these if your schema takes advantage of the
  59.      anyAttribute='##other' in the schema for schemas -->
  60.  
  61. <!ENTITY % schemaAttrs ''>
  62. <!ENTITY % complexTypeAttrs ''>
  63. <!ENTITY % complexContentAttrs ''>
  64. <!ENTITY % simpleContentAttrs ''>
  65. <!ENTITY % extensionAttrs ''>
  66. <!ENTITY % elementAttrs ''>
  67. <!ENTITY % groupAttrs ''>
  68. <!ENTITY % allAttrs ''>
  69. <!ENTITY % choiceAttrs ''>
  70. <!ENTITY % sequenceAttrs ''>
  71. <!ENTITY % anyAttrs ''>
  72. <!ENTITY % anyAttributeAttrs ''>
  73. <!ENTITY % attributeAttrs ''>
  74. <!ENTITY % attributeGroupAttrs ''>
  75. <!ENTITY % uniqueAttrs ''>
  76. <!ENTITY % keyAttrs ''>
  77. <!ENTITY % keyrefAttrs ''>
  78. <!ENTITY % selectorAttrs ''>
  79. <!ENTITY % fieldAttrs ''>
  80. <!ENTITY % includeAttrs ''>
  81. <!ENTITY % importAttrs ''>
  82. <!ENTITY % redefineAttrs ''>
  83. <!ENTITY % notationAttrs ''>
  84.  
  85. <!ENTITY % complexDerivationChoice "(extension|restriction)">
  86. <!ENTITY % complexDerivationSet "CDATA">
  87.       <!-- #all or space-separated list drawn from derivationChoice -->
  88. <!ENTITY % blockSet "CDATA">
  89.       <!-- #all or space-separated list drawn from
  90.                       derivationChoice + 'substitution' -->
  91.  
  92. <!ENTITY % mgs '%all; | %choice; | %sequence;'>
  93. <!ENTITY % cs '%choice; | %sequence;'>
  94. <!ENTITY % formValues '(qualified|unqualified)'>
  95.  
  96.  
  97. <!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
  98.  
  99. <!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
  100.  
  101. <!-- This is used in part2 -->
  102. <!ENTITY % restriction1 '((%mgs; | %group;)?)'>
  103.  
  104. %xs-datatypes;
  105.  
  106. <!-- the duplication below is to produce an unambiguous content model
  107.      which allows annotation everywhere -->
  108. <!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
  109.                     ((%simpleType; | %complexType;
  110.                       | %element; | %attribute;
  111.                       | %attributeGroup; | %group;
  112.                       | %notation; ),
  113.                      (%annotation;)*)* )>
  114. <!ATTLIST %schema;
  115.    targetNamespace      %URIref;               #IMPLIED
  116.    version              CDATA                  #IMPLIED
  117.    %nds;                %URIref;               #FIXED 'http://www.w3.org/2000/10/XMLSchema'
  118.    finalDefault         %complexDerivationSet; ''
  119.    blockDefault         %blockSet;             ''
  120.    id                   ID                     #IMPLIED
  121.    elementFormDefault   %formValues;           'unqualified'
  122.    attributeFormDefault %formValues;           'unqualified'
  123.    %schemaAttrs;>
  124. <!-- Note the xmlns declaration is NOT in the Schema for Schemas,
  125.      because at the Infoset level where schemas operate,
  126.      xmlns(:prefix) is NOT an attribute! -->
  127.  
  128. <!-- The id attribute here and below is for use in external references
  129.      from non-schemas using simple fragment identifiers.
  130.      It is NOT used for schema-to-schema reference, internal or
  131.      external. -->
  132.  
  133. <!-- a type is a named content type specification which allows attribute
  134.      declarations-->
  135. <!-- -->
  136.  
  137. <!ELEMENT %complexType; ((%annotation;)?,
  138.                          (%simpleContent;|%complexContent;|
  139.                           %particleAndAttrs;))>
  140.  
  141. <!ATTLIST %complexType;
  142.           name      %NCName;                        #IMPLIED
  143.           id        ID                              #IMPLIED
  144.           abstract  %boolean;                       'false'
  145.           final     %complexDerivationSet;          #IMPLIED
  146.           block     %complexDerivationSet;          ''
  147.           mixed (true|false) 'false'
  148.           %complexTypeAttrs;>
  149.  
  150. <!-- particleAndAttrs is shorthand for a root type -->
  151. <!-- mixed is disallowed if simpleContent, overriden if complexContent
  152.      has one too. -->
  153.  
  154. <!-- If anyAttribute appears in one or more referenced attributeGroups
  155.      and/or explicitly, the intersection of the permissions is used -->
  156.  
  157. <!ELEMENT %complexContent; (%restriction;|%extension;)>
  158. <!ATTLIST %complexContent;
  159.           mixed (true|false) #IMPLIED
  160.           id    ID           #IMPLIED
  161.           %complexContentAttrs;>
  162.  
  163. <!-- restriction should use the branch defined above, not the simple
  164.      one from part2; extension should use the full model  -->
  165.  
  166. <!ELEMENT %simpleContent; (%restriction;|%extension;)>
  167. <!ATTLIST %simpleContent;
  168.           id    ID           #IMPLIED
  169.           %simpleContentAttrs;>
  170.  
  171. <!-- restriction should use the simple branch from part2, not the 
  172.      one defined above; extension should have no particle  -->
  173.  
  174. <!ELEMENT %extension; (%particleAndAttrs;)>
  175. <!ATTLIST %extension;
  176.           base  %QName;      #REQUIRED
  177.           id    ID           #IMPLIED
  178.           %extensionAttrs;>
  179.  
  180. <!-- an element is declared by either:
  181.  a name and a type (either nested or referenced via the type attribute)
  182.  or a ref to an existing element declaration -->
  183.  
  184. <!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
  185.                      (%unique; | %key; | %keyref;)*)>
  186. <!-- simpleType or complexType only if no type|ref attribute -->
  187. <!-- ref not allowed at top level -->
  188. <!ATTLIST %element;
  189.             name               %NCName;               #IMPLIED
  190.             id                 ID                     #IMPLIED
  191.             ref                %QName;                #IMPLIED
  192.             type               %QName;                #IMPLIED
  193.             minOccurs          %nonNegativeInteger;   #IMPLIED
  194.             maxOccurs          CDATA                  #IMPLIED
  195.             nullable           %boolean;              'false'
  196.             substitutionGroup  %QName;                #IMPLIED
  197.             abstract           %boolean;              'false'
  198.             final              %complexDerivationSet; #IMPLIED
  199.             block              %blockSet;             ''
  200.             default            CDATA                  #IMPLIED
  201.             fixed              CDATA                  #IMPLIED
  202.             form               %formValues;           #IMPLIED
  203.             %elementAttrs;>
  204. <!-- type and ref are mutually exclusive.
  205.      name and ref are mutually exclusive, one is required -->
  206. <!-- In the absence of type AND ref, type defaults to type of
  207.      substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
  208. <!-- default and fixed are mutually exclusive -->
  209.  
  210. <!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
  211. <!ATTLIST %group; 
  212.           name        %NCName;               #IMPLIED
  213.           ref         %QName;                #IMPLIED
  214.           minOccurs   %nonNegativeInteger;   #IMPLIED
  215.           maxOccurs   CDATA                  #IMPLIED
  216.           id          ID                     #IMPLIED
  217.           %groupAttrs;>
  218.  
  219. <!ELEMENT %all; ((%annotation;)?, (%element;)*)>
  220. <!ATTLIST %all;
  221.           minOccurs   (1)                    #FIXED '1'
  222.           maxOccurs   (1)                    #FIXED '1'
  223.           id          ID                     #IMPLIED
  224.           %allAttrs;>
  225.  
  226. <!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
  227. <!ATTLIST %choice;
  228.           minOccurs   %nonNegativeInteger;   '1'
  229.           maxOccurs   CDATA                  '1'
  230.           id          ID                     #IMPLIED
  231.           %choiceAttrs;>
  232.  
  233. <!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
  234. <!ATTLIST %sequence;
  235.           minOccurs   %nonNegativeInteger;   '1'
  236.           maxOccurs   CDATA                  '1'
  237.           id          ID                     #IMPLIED
  238.           %sequenceAttrs;>
  239.  
  240. <!-- an anonymous grouping in a model, or
  241.      a top-level named group definition, or a reference to same -->
  242.  
  243. <!-- Note that if order is 'all', group is not allowed inside.
  244.      If order is 'all' THIS group must be alone (or referenced alone) at
  245.      the top level of a content model -->
  246. <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
  247. <!-- Should allow minOccurs=0 inside order='all' . . . -->
  248.  
  249. <!ELEMENT %any; (%annotation;)?>
  250. <!ATTLIST %any;
  251.             namespace       CDATA                  '##any'
  252.             processContents (skip|lax|strict)      'strict'
  253.             minOccurs       %nonNegativeInteger;   '1'
  254.             maxOccurs       CDATA                  '1'
  255.             id              ID                     #IMPLIED
  256.             %anyAttrs;>
  257.  
  258. <!-- namespace is interpreted as follows:
  259.                   ##any      - - any non-conflicting WFXML at all
  260.  
  261.                   ##other    - - any non-conflicting WFXML from namespace other
  262.                                   than targetNamespace
  263.  
  264.                   ##local    - - any unqualified non-conflicting WFXML/attribute
  265.                   one or     - - any non-conflicting WFXML from
  266.                   more URI        the listed namespaces
  267.                   references
  268.  
  269.                   ##targetNamespace ##local may appear in the above list,
  270.                     with the obvious meaning -->
  271.  
  272. <!ELEMENT %anyAttribute; (%annotation;)?>
  273. <!ATTLIST %anyAttribute;
  274.             namespace       CDATA              '##any'
  275.             processContents (skip|lax|strict)  'strict'
  276.             id              ID                 #IMPLIED
  277.             %anyAttributeAttrs;>
  278. <!-- namespace is interpreted as for 'any' above -->
  279.  
  280. <!-- simpleType only if no type|ref attribute -->
  281. <!-- ref not allowed at top level, name iff at top level -->
  282. <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
  283. <!ATTLIST %attribute;
  284.           name      %NCName;      #IMPLIED
  285.           id        ID            #IMPLIED
  286.           ref       %QName;       #IMPLIED
  287.           type      %QName;       #IMPLIED
  288.           use       (prohibited|optional|required|fixed|default) #IMPLIED
  289.           value     CDATA         #IMPLIED
  290.           form      %formValues;  #IMPLIED
  291.           %attributeAttrs;>
  292. <!-- type and ref are mutually exclusive.
  293.      name and ref are mutually exclusive, one is required -->
  294. <!-- value only if use is fixed, required or default, or name -->
  295. <!-- name and use are mutually exclusive -->
  296. <!-- default for use is optional when nested, none otherwise -->
  297. <!-- type attr and simpleType content are mutually exclusive -->
  298.  
  299. <!-- an attributeGroup is a named collection of attribute decls, or a
  300.      reference thereto -->
  301. <!ELEMENT %attributeGroup; ((%annotation;)?,
  302.                        (%attribute; | %attributeGroup;)*,
  303.                        (%anyAttribute;)?) >
  304. <!ATTLIST %attributeGroup;
  305.                  name       %NCName;       #IMPLIED
  306.                  id         ID             #IMPLIED
  307.                  ref        %QName;        #IMPLIED
  308.                  %attributeGroupAttrs;>
  309.  
  310. <!-- ref iff no content, no name.  ref iff not top level -->
  311.  
  312. <!-- better reference mechanisms -->
  313. <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
  314. <!ATTLIST %unique;
  315.           name     %NCName;       #REQUIRED
  316.       id       ID             #IMPLIED
  317.       %uniqueAttrs;>
  318.  
  319. <!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
  320. <!ATTLIST %key;
  321.           name     %NCName;       #REQUIRED
  322.       id       ID             #IMPLIED
  323.       %keyAttrs;>
  324.  
  325. <!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
  326. <!ATTLIST %keyref;
  327.           name     %NCName;       #REQUIRED
  328.       refer    %QName;        #REQUIRED
  329.       id       ID             #IMPLIED
  330.       %keyrefAttrs;>
  331.  
  332. <!ELEMENT %selector; ((%annotation;)?)>
  333. <!ATTLIST %selector;
  334.           xpath %XPathExpr; #REQUIRED
  335.           id    ID          #IMPLIED
  336.           %selectorAttrs;>
  337. <!ELEMENT %field; ((%annotation;)?)>
  338. <!ATTLIST %field;
  339.           xpath %XPathExpr; #REQUIRED
  340.           id    ID          #IMPLIED
  341.           %fieldAttrs;>
  342.  
  343. <!-- Schema combination mechanisms -->
  344. <!ELEMENT %include; (%annotation;)?>
  345. <!ATTLIST %include;
  346.           schemaLocation %URIref; #REQUIRED
  347.           id             ID       #IMPLIED
  348.           %includeAttrs;>
  349.  
  350. <!ELEMENT %import; (%annotation;)?>
  351. <!ATTLIST %import;
  352.           namespace      %URIref; #IMPLIED
  353.           schemaLocation %URIref; #IMPLIED
  354.           id             ID       #IMPLIED
  355.           %importAttrs;>
  356.  
  357. <!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
  358.                       %attributeGroup; | %group;)*>
  359. <!ATTLIST %redefine;
  360.           schemaLocation %URIref; #REQUIRED
  361.           id             ID       #IMPLIED
  362.           %redefineAttrs;>
  363.  
  364. <!ELEMENT %notation; (%annotation;)?>
  365. <!ATTLIST %notation;
  366.       name        %NCName;    #REQUIRED
  367.       id          ID          #IMPLIED
  368.       public      CDATA       #REQUIRED
  369.       system      %URIref;    #IMPLIED
  370.       %notationAttrs;>
  371.  
  372. <!-- Annotation is either application information or documentation -->
  373. <!-- By having these here they are available for datatypes as well
  374.      as all the structures elements -->
  375.  
  376. <!ELEMENT %annotation; (%appinfo; | %documentation;)*>
  377.  
  378. <!-- User must define annotation elements in internal subset for this
  379.      to work -->
  380. <!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
  381. <!ATTLIST %appinfo;
  382.           source     %URIref;      #IMPLIED
  383.           id         ID         #IMPLIED
  384.           %appinfoAttrs;>
  385. <!ELEMENT %documentation; ANY>   <!-- too restrictive -->
  386. <!ATTLIST %documentation;
  387.           source     %URIref;   #IMPLIED
  388.           id         ID         #IMPLIED
  389.           xml:lang   CDATA      #IMPLIED
  390.           %documentationAttrs;>
  391.  
  392. <!NOTATION XMLSchemaStructures PUBLIC
  393.            'structures' 'http://www.w3.org/2000/10/XMLSchema.xsd' >
  394. <!NOTATION XML PUBLIC
  395.            'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >
  396.