samlesa 2.14.7 → 2.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/build/index.js +0 -1
  2. package/build/src/api.js +2 -2
  3. package/build/src/binding-post.js +0 -1
  4. package/build/src/binding-redirect.js +0 -1
  5. package/build/src/binding-simplesign.js +0 -1
  6. package/build/src/entity-idp.js +0 -1
  7. package/build/src/entity-sp.js +0 -1
  8. package/build/src/entity.js +0 -1
  9. package/build/src/extractor.js +0 -1
  10. package/build/src/flow.js +0 -1
  11. package/build/src/libsaml.js +0 -74
  12. package/build/src/metadata-idp.js +0 -1
  13. package/build/src/metadata-sp.js +0 -1
  14. package/build/src/metadata.js +0 -1
  15. package/build/src/schema/XMLSchema.dtd +402 -0
  16. package/build/src/schema/datatypes.dtd +203 -0
  17. package/build/src/schema/saml-schema-assertion-2.0.xsd +283 -0
  18. package/build/src/schema/saml-schema-authn-context-2.0.xsd +23 -0
  19. package/build/src/schema/saml-schema-authn-context-auth-telephony-2.0.xsd +81 -0
  20. package/build/src/schema/saml-schema-authn-context-ip-2.0.xsd +65 -0
  21. package/build/src/schema/saml-schema-authn-context-ippword-2.0.xsd +67 -0
  22. package/build/src/schema/saml-schema-authn-context-kerberos-2.0.xsd +83 -0
  23. package/build/src/schema/saml-schema-authn-context-mobileonefactor-reg-2.0.xsd +186 -0
  24. package/build/src/schema/saml-schema-authn-context-mobileonefactor-unreg-2.0.xsd +183 -0
  25. package/build/src/schema/saml-schema-authn-context-mobiletwofactor-reg-2.0.xsd +202 -0
  26. package/build/src/schema/saml-schema-authn-context-mobiletwofactor-unreg-2.0.xsd +200 -0
  27. package/build/src/schema/saml-schema-authn-context-nomad-telephony-2.0.xsd +81 -0
  28. package/build/src/schema/saml-schema-authn-context-personal-telephony-2.0.xsd +80 -0
  29. package/build/src/schema/saml-schema-authn-context-pgp-2.0.xsd +83 -0
  30. package/build/src/schema/saml-schema-authn-context-ppt-2.0.xsd +81 -0
  31. package/build/src/schema/saml-schema-authn-context-pword-2.0.xsd +64 -0
  32. package/build/src/schema/saml-schema-authn-context-session-2.0.xsd +64 -0
  33. package/build/src/schema/saml-schema-authn-context-smartcard-2.0.xsd +64 -0
  34. package/build/src/schema/saml-schema-authn-context-smartcardpki-2.0.xsd +129 -0
  35. package/build/src/schema/saml-schema-authn-context-softwarepki-2.0.xsd +129 -0
  36. package/build/src/schema/saml-schema-authn-context-spki-2.0.xsd +83 -0
  37. package/build/src/schema/saml-schema-authn-context-srp-2.0.xsd +82 -0
  38. package/build/src/schema/saml-schema-authn-context-sslcert-2.0.xsd +97 -0
  39. package/build/src/schema/saml-schema-authn-context-telephony-2.0.xsd +79 -0
  40. package/build/src/schema/saml-schema-authn-context-timesync-2.0.xsd +105 -0
  41. package/build/src/schema/saml-schema-authn-context-types-2.0.xsd +821 -0
  42. package/build/src/schema/saml-schema-authn-context-x509-2.0.xsd +83 -0
  43. package/build/src/schema/saml-schema-authn-context-xmldsig-2.0.xsd +83 -0
  44. package/build/src/schema/saml-schema-dce-2.0.xsd +29 -0
  45. package/build/src/schema/saml-schema-ecp-2.0.xsd +57 -0
  46. package/build/src/schema/saml-schema-metadata-2.0.xsd +337 -0
  47. package/build/src/schema/saml-schema-protocol-2.0.xsd +302 -0
  48. package/build/src/schema/saml-schema-x500-2.0.xsd +20 -0
  49. package/build/src/schema/saml-schema-xacml-2.0.xsd +19 -0
  50. package/build/src/schema/xenc-schema.xsd +145 -0
  51. package/build/src/schema/xmldsig-core-schema.xsd +317 -0
  52. package/build/src/schemaValidator.js +40 -0
  53. package/build/src/types.js +0 -1
  54. package/build/src/urn.js +0 -1
  55. package/build/src/utility.js +0 -1
  56. package/build/src/validator.js +0 -1
  57. package/package.json +80 -75
  58. package/types/api.d.ts +15 -0
  59. package/types/api.d.ts.map +1 -0
  60. package/types/binding-post.d.ts +48 -0
  61. package/types/binding-post.d.ts.map +1 -0
  62. package/types/binding-redirect.d.ts +54 -0
  63. package/types/binding-redirect.d.ts.map +1 -0
  64. package/types/binding-simplesign.d.ts +41 -0
  65. package/types/binding-simplesign.d.ts.map +1 -0
  66. package/types/entity-idp.d.ts +38 -0
  67. package/types/entity-idp.d.ts.map +1 -0
  68. package/types/entity-sp.d.ts +38 -0
  69. package/types/entity-sp.d.ts.map +1 -0
  70. package/types/entity.d.ts +100 -0
  71. package/types/entity.d.ts.map +1 -0
  72. package/types/extractor.d.ts +26 -0
  73. package/types/extractor.d.ts.map +1 -0
  74. package/types/flow.d.ts +7 -0
  75. package/types/flow.d.ts.map +1 -0
  76. package/types/libsaml.d.ts +208 -0
  77. package/types/libsaml.d.ts.map +1 -0
  78. package/types/metadata-idp.d.ts +25 -0
  79. package/types/metadata-idp.d.ts.map +1 -0
  80. package/types/metadata-sp.d.ts +37 -0
  81. package/types/metadata-sp.d.ts.map +1 -0
  82. package/types/metadata.d.ts +58 -0
  83. package/types/metadata.d.ts.map +1 -0
  84. package/types/src/api.d.ts.map +1 -1
  85. package/types/src/libsaml.d.ts +0 -1
  86. package/types/src/libsaml.d.ts.map +1 -1
  87. package/types/src/schemaValidator.d.ts +2 -0
  88. package/types/src/schemaValidator.d.ts.map +1 -0
  89. package/types/src/utility.d.ts.map +1 -1
  90. package/types/types.d.ts +128 -0
  91. package/types/types.d.ts.map +1 -0
  92. package/types/urn.d.ts +195 -0
  93. package/types/urn.d.ts.map +1 -0
  94. package/types/utility.d.ts +133 -0
  95. package/types/utility.d.ts.map +1 -0
  96. package/types/validator.d.ts +4 -0
  97. package/types/validator.d.ts.map +1 -0
  98. package/build/index.js.map +0 -1
  99. package/build/src/api.js.map +0 -1
  100. package/build/src/binding-post.js.map +0 -1
  101. package/build/src/binding-redirect.js.map +0 -1
  102. package/build/src/binding-simplesign.js.map +0 -1
  103. package/build/src/entity-idp.js.map +0 -1
  104. package/build/src/entity-sp.js.map +0 -1
  105. package/build/src/entity.js.map +0 -1
  106. package/build/src/extractor.js.map +0 -1
  107. package/build/src/flow.js.map +0 -1
  108. package/build/src/libsaml.js.map +0 -1
  109. package/build/src/metadata-idp.js.map +0 -1
  110. package/build/src/metadata-sp.js.map +0 -1
  111. package/build/src/metadata.js.map +0 -1
  112. package/build/src/types.js.map +0 -1
  113. package/build/src/urn.js.map +0 -1
  114. package/build/src/utility.js.map +0 -1
  115. package/build/src/validator.js.map +0 -1
package/build/index.js CHANGED
@@ -16,4 +16,3 @@ export { Constants, Extractor,
16
16
  IdentityProvider, IdentityProviderInstance, ServiceProvider, ServiceProviderInstance,
17
17
  // set context
18
18
  setSchemaValidator, setDOMParserOptions };
19
- //# sourceMappingURL=index.js.map
package/build/src/api.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { DOMParser as dom } from '@xmldom/xmldom';
2
+ import { validate as defaultValidator } from "./schemaValidator.js";
2
3
  const context = {
3
- validate: undefined,
4
+ validate: defaultValidator,
4
5
  dom: new dom()
5
6
  };
6
7
  export function getContext() {
@@ -16,4 +17,3 @@ export function setSchemaValidator(params) {
16
17
  export function setDOMParserOptions(options = {}) {
17
18
  context.dom = new dom(options);
18
19
  }
19
- //# sourceMappingURL=api.js.map
@@ -335,4 +335,3 @@ const postBinding = {
335
335
  base64LogoutResponse,
336
336
  };
337
337
  export default postBinding;
338
- //# sourceMappingURL=binding-post.js.map
@@ -310,4 +310,3 @@ const redirectBinding = {
310
310
  logoutResponseRedirectURL,
311
311
  };
312
312
  export default redirectBinding;
313
- //# sourceMappingURL=binding-redirect.js.map
@@ -199,4 +199,3 @@ const simpleSignBinding = {
199
199
  base64LoginResponse,
200
200
  };
201
201
  export default simpleSignBinding;
202
- //# sourceMappingURL=binding-simplesign.js.map
@@ -91,4 +91,3 @@ export class IdentityProvider extends Entity {
91
91
  });
92
92
  }
93
93
  }
94
- //# sourceMappingURL=entity-idp.js.map
@@ -86,4 +86,3 @@ export class ServiceProvider extends Entity {
86
86
  });
87
87
  }
88
88
  }
89
- //# sourceMappingURL=entity-sp.js.map
@@ -191,4 +191,3 @@ export default class Entity {
191
191
  });
192
192
  }
193
193
  }
194
- //# sourceMappingURL=entity.js.map
@@ -359,4 +359,3 @@ export function extract(context, fields) {
359
359
  return result;
360
360
  }, {});
361
361
  }
362
- //# sourceMappingURL=extractor.js.map
package/build/src/flow.js CHANGED
@@ -371,4 +371,3 @@ export function flow(options) {
371
371
  }
372
372
  return Promise.reject('ERR_UNEXPECTED_FLOW');
373
373
  }
374
- //# sourceMappingURL=flow.js.map
@@ -311,79 +311,6 @@ const libSaml = () => {
311
311
  }
312
312
  return isBase64Output !== false ? utility.base64Encode(sig.getSignedXml()) : sig.getSignedXml();
313
313
  },
314
- checkSamlSignatureOrder(samlResponseXml) {
315
- const { dom } = getContext();
316
- const doc = dom.parseFromString(samlResponseXml, 'application/xml');
317
- // 获取 Response 根节点
318
- const response = doc.documentElement;
319
- if (!response || response.localName !== "Response") {
320
- throw new Error("Invalid SAML Response");
321
- }
322
- // 获取 Response 的 ID
323
- const responseId = response.getAttribute("ID");
324
- // 查找 Response 下的直接子节点
325
- const children = Array.from(response.childNodes).filter((node) => node.nodeType === 1); // 过滤非元素节点
326
- // 1. 查找签名块 (可能带不同前缀: ds: 或 dsig:)
327
- const signature = children.find((node) => {
328
- // @ts-ignore
329
- const localName = node.nodeName;
330
- console.log("这就是名字1");
331
- console.log(localName);
332
- // @ts-ignore
333
- const ns = node.namespaceURI;
334
- return ((localName.includes("Signature") && ns === "http://www.w3.org/2000/09/xmldsig#")
335
- || node.nodeName.includes("Signature"));
336
- });
337
- if (!signature) {
338
- throw new Error("SAML Response is not signed");
339
- }
340
- // @ts-ignore
341
- // 2. 检查签名的 Reference URI
342
- // @ts-ignore
343
- console.log(signature.getElementsByTagName("Reference"));
344
- console.log("找到了神恶魔---------------");
345
- // @ts-ignore
346
- const reference = Array.from(signature.getElementsByTagName("Reference")).find((ref) => {
347
- // @ts-ignore
348
- console.log(ref?.parentNode?.localName);
349
- console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
350
- // @ts-ignore
351
- return ref?.parentNode?.localName?.includes("SignedInfo");
352
- });
353
- console.log(reference);
354
- console.log("给我看一下-----------------");
355
- // @ts-ignore
356
- const referenceUri = reference?.getAttribute("URI") || "";
357
- console.log("1他妈的-------------------");
358
- console.log(referenceUri);
359
- console.log(`#${responseId}`);
360
- console.log("他妈的-------------------");
361
- // 是否对整个 Response 签名
362
- const isSignWholeResponse = referenceUri === `#${responseId}`;
363
- // 3. 查找 EncryptedAssertion
364
- const encryptedAssertion = children.find((node) => {
365
- // @ts-ignore
366
- const localName = node?.localName;
367
- return ((localName === "EncryptedAssertion")
368
- || node.nodeName.includes("EncryptedAssertion"));
369
- });
370
- if (!encryptedAssertion) {
371
- throw new Error("EncryptedAssertion not found");
372
- }
373
- // 4. 比较签名和加密断言的位置索引
374
- const signatureIndex = children.indexOf(signature);
375
- const encryptedIndex = children.indexOf(encryptedAssertion);
376
- console.log(signatureIndex);
377
- console.log(encryptedIndex);
378
- console.log("66666666666666666");
379
- // 判断逻辑
380
- if (isSignWholeResponse && encryptedIndex > signatureIndex) {
381
- return "encrypt-then-sign"; // 先加密后签名
382
- }
383
- else {
384
- return "sign-then-encrypt"; // 先签名后加密
385
- }
386
- },
387
314
  /**
388
315
  * @desc Verify the XML signature
389
316
  * @param {string} xml xml
@@ -767,4 +694,3 @@ const libSaml = () => {
767
694
  };
768
695
  };
769
696
  export default libSaml();
770
- //# sourceMappingURL=libsaml.js.map
@@ -131,4 +131,3 @@ export class IdpMetadata extends Metadata {
131
131
  return this.meta.singleSignOnService;
132
132
  }
133
133
  }
134
- //# sourceMappingURL=metadata-idp.js.map
@@ -237,4 +237,3 @@ export class SpMetadata extends Metadata {
237
237
  return this.meta.assertionConsumerService;
238
238
  }
239
239
  }
240
- //# sourceMappingURL=metadata-sp.js.map
@@ -136,4 +136,3 @@ export default class Metadata {
136
136
  return supportBindings;
137
137
  }
138
138
  }
139
- //# sourceMappingURL=metadata.js.map
@@ -0,0 +1,402 @@
1
+ <!-- DTD for XML Schemas: Part 1: Structures
2
+ Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
3
+ Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
4
+ <!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 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 'xs:'> <!-- can be overriden in the internal subset of a
21
+ schema document to establish a different
22
+ namespace prefix -->
23
+ <!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
24
+ also define %s as the suffix for the appropriate
25
+ namespace declaration (e.g. :foo) -->
26
+ <!ENTITY % nds 'xmlns%s;'>
27
+
28
+ <!-- Define all the element names, with optional prefix -->
29
+ <!ENTITY % schema "%p;schema">
30
+ <!ENTITY % complexType "%p;complexType">
31
+ <!ENTITY % complexContent "%p;complexContent">
32
+ <!ENTITY % simpleContent "%p;simpleContent">
33
+ <!ENTITY % extension "%p;extension">
34
+ <!ENTITY % element "%p;element">
35
+ <!ENTITY % unique "%p;unique">
36
+ <!ENTITY % key "%p;key">
37
+ <!ENTITY % keyref "%p;keyref">
38
+ <!ENTITY % selector "%p;selector">
39
+ <!ENTITY % field "%p;field">
40
+ <!ENTITY % group "%p;group">
41
+ <!ENTITY % all "%p;all">
42
+ <!ENTITY % choice "%p;choice">
43
+ <!ENTITY % sequence "%p;sequence">
44
+ <!ENTITY % any "%p;any">
45
+ <!ENTITY % anyAttribute "%p;anyAttribute">
46
+ <!ENTITY % attribute "%p;attribute">
47
+ <!ENTITY % attributeGroup "%p;attributeGroup">
48
+ <!ENTITY % include "%p;include">
49
+ <!ENTITY % import "%p;import">
50
+ <!ENTITY % redefine "%p;redefine">
51
+ <!ENTITY % notation "%p;notation">
52
+
53
+ <!-- annotation elements -->
54
+ <!ENTITY % annotation "%p;annotation">
55
+ <!ENTITY % appinfo "%p;appinfo">
56
+ <!ENTITY % documentation "%p;documentation">
57
+
58
+ <!-- Customisation entities for the ATTLIST of each element type.
59
+ Define one of these if your schema takes advantage of the
60
+ anyAttribute='##other' in the schema for schemas -->
61
+
62
+ <!ENTITY % schemaAttrs ''>
63
+ <!ENTITY % complexTypeAttrs ''>
64
+ <!ENTITY % complexContentAttrs ''>
65
+ <!ENTITY % simpleContentAttrs ''>
66
+ <!ENTITY % extensionAttrs ''>
67
+ <!ENTITY % elementAttrs ''>
68
+ <!ENTITY % groupAttrs ''>
69
+ <!ENTITY % allAttrs ''>
70
+ <!ENTITY % choiceAttrs ''>
71
+ <!ENTITY % sequenceAttrs ''>
72
+ <!ENTITY % anyAttrs ''>
73
+ <!ENTITY % anyAttributeAttrs ''>
74
+ <!ENTITY % attributeAttrs ''>
75
+ <!ENTITY % attributeGroupAttrs ''>
76
+ <!ENTITY % uniqueAttrs ''>
77
+ <!ENTITY % keyAttrs ''>
78
+ <!ENTITY % keyrefAttrs ''>
79
+ <!ENTITY % selectorAttrs ''>
80
+ <!ENTITY % fieldAttrs ''>
81
+ <!ENTITY % includeAttrs ''>
82
+ <!ENTITY % importAttrs ''>
83
+ <!ENTITY % redefineAttrs ''>
84
+ <!ENTITY % notationAttrs ''>
85
+ <!ENTITY % annotationAttrs ''>
86
+ <!ENTITY % appinfoAttrs ''>
87
+ <!ENTITY % documentationAttrs ''>
88
+
89
+ <!ENTITY % complexDerivationSet "CDATA">
90
+ <!-- #all or space-separated list drawn from derivationChoice -->
91
+ <!ENTITY % blockSet "CDATA">
92
+ <!-- #all or space-separated list drawn from
93
+ derivationChoice + 'substitution' -->
94
+
95
+ <!ENTITY % mgs '%all; | %choice; | %sequence;'>
96
+ <!ENTITY % cs '%choice; | %sequence;'>
97
+ <!ENTITY % formValues '(qualified|unqualified)'>
98
+
99
+
100
+ <!ENTITY % attrDecls '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
101
+
102
+ <!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
103
+
104
+ <!-- This is used in part2 -->
105
+ <!ENTITY % restriction1 '((%mgs; | %group;)?)'>
106
+
107
+ %xs-datatypes;
108
+
109
+ <!-- the duplication below is to produce an unambiguous content model
110
+ which allows annotation everywhere -->
111
+ <!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
112
+ ((%simpleType; | %complexType;
113
+ | %element; | %attribute;
114
+ | %attributeGroup; | %group;
115
+ | %notation; ),
116
+ (%annotation;)*)* )>
117
+ <!ATTLIST %schema;
118
+ targetNamespace %URIref; #IMPLIED
119
+ version CDATA #IMPLIED
120
+ %nds; %URIref; #FIXED 'http://www.w3.org/2001/XMLSchema'
121
+ xmlns CDATA #IMPLIED
122
+ finalDefault %complexDerivationSet; ''
123
+ blockDefault %blockSet; ''
124
+ id ID #IMPLIED
125
+ elementFormDefault %formValues; 'unqualified'
126
+ attributeFormDefault %formValues; 'unqualified'
127
+ xml:lang CDATA #IMPLIED
128
+ %schemaAttrs;>
129
+ <!-- Note the xmlns declaration is NOT in the Schema for Schemas,
130
+ because at the Infoset level where schemas operate,
131
+ xmlns(:prefix) is NOT an attribute! -->
132
+ <!-- The declaration of xmlns is a convenience for schema authors -->
133
+
134
+ <!-- The id attribute here and below is for use in external references
135
+ from non-schemas using simple fragment identifiers.
136
+ It is NOT used for schema-to-schema reference, internal or
137
+ external. -->
138
+
139
+ <!-- a type is a named content type specification which allows attribute
140
+ declarations-->
141
+ <!-- -->
142
+
143
+ <!ELEMENT %complexType; ((%annotation;)?,
144
+ (%simpleContent;|%complexContent;|
145
+ %particleAndAttrs;))>
146
+
147
+ <!ATTLIST %complexType;
148
+ name %NCName; #IMPLIED
149
+ id ID #IMPLIED
150
+ abstract %boolean; #IMPLIED
151
+ final %complexDerivationSet; #IMPLIED
152
+ block %complexDerivationSet; #IMPLIED
153
+ mixed (true|false) 'false'
154
+ %complexTypeAttrs;>
155
+
156
+ <!-- particleAndAttrs is shorthand for a root type -->
157
+ <!-- mixed is disallowed if simpleContent, overriden if complexContent
158
+ has one too. -->
159
+
160
+ <!-- If anyAttribute appears in one or more referenced attributeGroups
161
+ and/or explicitly, the intersection of the permissions is used -->
162
+
163
+ <!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
164
+ <!ATTLIST %complexContent;
165
+ mixed (true|false) #IMPLIED
166
+ id ID #IMPLIED
167
+ %complexContentAttrs;>
168
+
169
+ <!-- restriction should use the branch defined above, not the simple
170
+ one from part2; extension should use the full model -->
171
+
172
+ <!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
173
+ <!ATTLIST %simpleContent;
174
+ id ID #IMPLIED
175
+ %simpleContentAttrs;>
176
+
177
+ <!-- restriction should use the simple branch from part2, not the
178
+ one defined above; extension should have no particle -->
179
+
180
+ <!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
181
+ <!ATTLIST %extension;
182
+ base %QName; #REQUIRED
183
+ id ID #IMPLIED
184
+ %extensionAttrs;>
185
+
186
+ <!-- an element is declared by either:
187
+ a name and a type (either nested or referenced via the type attribute)
188
+ or a ref to an existing element declaration -->
189
+
190
+ <!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
191
+ (%unique; | %key; | %keyref;)*)>
192
+ <!-- simpleType or complexType only if no type|ref attribute -->
193
+ <!-- ref not allowed at top level -->
194
+ <!ATTLIST %element;
195
+ name %NCName; #IMPLIED
196
+ id ID #IMPLIED
197
+ ref %QName; #IMPLIED
198
+ type %QName; #IMPLIED
199
+ minOccurs %nonNegativeInteger; #IMPLIED
200
+ maxOccurs CDATA #IMPLIED
201
+ nillable %boolean; #IMPLIED
202
+ substitutionGroup %QName; #IMPLIED
203
+ abstract %boolean; #IMPLIED
204
+ final %complexDerivationSet; #IMPLIED
205
+ block %blockSet; #IMPLIED
206
+ default CDATA #IMPLIED
207
+ fixed CDATA #IMPLIED
208
+ form %formValues; #IMPLIED
209
+ %elementAttrs;>
210
+ <!-- type and ref are mutually exclusive.
211
+ name and ref are mutually exclusive, one is required -->
212
+ <!-- In the absence of type AND ref, type defaults to type of
213
+ substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
214
+ <!-- default and fixed are mutually exclusive -->
215
+
216
+ <!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
217
+ <!ATTLIST %group;
218
+ name %NCName; #IMPLIED
219
+ ref %QName; #IMPLIED
220
+ minOccurs %nonNegativeInteger; #IMPLIED
221
+ maxOccurs CDATA #IMPLIED
222
+ id ID #IMPLIED
223
+ %groupAttrs;>
224
+
225
+ <!ELEMENT %all; ((%annotation;)?, (%element;)*)>
226
+ <!ATTLIST %all;
227
+ minOccurs (1) #IMPLIED
228
+ maxOccurs (1) #IMPLIED
229
+ id ID #IMPLIED
230
+ %allAttrs;>
231
+
232
+ <!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
233
+ <!ATTLIST %choice;
234
+ minOccurs %nonNegativeInteger; #IMPLIED
235
+ maxOccurs CDATA #IMPLIED
236
+ id ID #IMPLIED
237
+ %choiceAttrs;>
238
+
239
+ <!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
240
+ <!ATTLIST %sequence;
241
+ minOccurs %nonNegativeInteger; #IMPLIED
242
+ maxOccurs CDATA #IMPLIED
243
+ id ID #IMPLIED
244
+ %sequenceAttrs;>
245
+
246
+ <!-- an anonymous grouping in a model, or
247
+ a top-level named group definition, or a reference to same -->
248
+
249
+ <!-- Note that if order is 'all', group is not allowed inside.
250
+ If order is 'all' THIS group must be alone (or referenced alone) at
251
+ the top level of a content model -->
252
+ <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
253
+ <!-- Should allow minOccurs=0 inside order='all' . . . -->
254
+
255
+ <!ELEMENT %any; (%annotation;)?>
256
+ <!ATTLIST %any;
257
+ namespace CDATA '##any'
258
+ processContents (skip|lax|strict) 'strict'
259
+ minOccurs %nonNegativeInteger; '1'
260
+ maxOccurs CDATA '1'
261
+ id ID #IMPLIED
262
+ %anyAttrs;>
263
+
264
+ <!-- namespace is interpreted as follows:
265
+ ##any - - any non-conflicting WFXML at all
266
+
267
+ ##other - - any non-conflicting WFXML from namespace other
268
+ than targetNamespace
269
+
270
+ ##local - - any unqualified non-conflicting WFXML/attribute
271
+ one or - - any non-conflicting WFXML from
272
+ more URI the listed namespaces
273
+ references
274
+
275
+ ##targetNamespace ##local may appear in the above list,
276
+ with the obvious meaning -->
277
+
278
+ <!ELEMENT %anyAttribute; (%annotation;)?>
279
+ <!ATTLIST %anyAttribute;
280
+ namespace CDATA '##any'
281
+ processContents (skip|lax|strict) 'strict'
282
+ id ID #IMPLIED
283
+ %anyAttributeAttrs;>
284
+ <!-- namespace is interpreted as for 'any' above -->
285
+
286
+ <!-- simpleType only if no type|ref attribute -->
287
+ <!-- ref not allowed at top level, name iff at top level -->
288
+ <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
289
+ <!ATTLIST %attribute;
290
+ name %NCName; #IMPLIED
291
+ id ID #IMPLIED
292
+ ref %QName; #IMPLIED
293
+ type %QName; #IMPLIED
294
+ use (prohibited|optional|required) #IMPLIED
295
+ default CDATA #IMPLIED
296
+ fixed CDATA #IMPLIED
297
+ form %formValues; #IMPLIED
298
+ %attributeAttrs;>
299
+ <!-- type and ref are mutually exclusive.
300
+ name and ref are mutually exclusive, one is required -->
301
+ <!-- default for use is optional when nested, none otherwise -->
302
+ <!-- default and fixed are mutually exclusive -->
303
+ <!-- type attr and simpleType content are mutually exclusive -->
304
+
305
+ <!-- an attributeGroup is a named collection of attribute decls, or a
306
+ reference thereto -->
307
+ <!ELEMENT %attributeGroup; ((%annotation;)?,
308
+ (%attribute; | %attributeGroup;)*,
309
+ (%anyAttribute;)?) >
310
+ <!ATTLIST %attributeGroup;
311
+ name %NCName; #IMPLIED
312
+ id ID #IMPLIED
313
+ ref %QName; #IMPLIED
314
+ %attributeGroupAttrs;>
315
+
316
+ <!-- ref iff no content, no name. ref iff not top level -->
317
+
318
+ <!-- better reference mechanisms -->
319
+ <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
320
+ <!ATTLIST %unique;
321
+ name %NCName; #REQUIRED
322
+ id ID #IMPLIED
323
+ %uniqueAttrs;>
324
+
325
+ <!ELEMENT %key; ((%annotation;)?, %selector;, (%field;)+)>
326
+ <!ATTLIST %key;
327
+ name %NCName; #REQUIRED
328
+ id ID #IMPLIED
329
+ %keyAttrs;>
330
+
331
+ <!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
332
+ <!ATTLIST %keyref;
333
+ name %NCName; #REQUIRED
334
+ refer %QName; #REQUIRED
335
+ id ID #IMPLIED
336
+ %keyrefAttrs;>
337
+
338
+ <!ELEMENT %selector; ((%annotation;)?)>
339
+ <!ATTLIST %selector;
340
+ xpath %XPathExpr; #REQUIRED
341
+ id ID #IMPLIED
342
+ %selectorAttrs;>
343
+ <!ELEMENT %field; ((%annotation;)?)>
344
+ <!ATTLIST %field;
345
+ xpath %XPathExpr; #REQUIRED
346
+ id ID #IMPLIED
347
+ %fieldAttrs;>
348
+
349
+ <!-- Schema combination mechanisms -->
350
+ <!ELEMENT %include; (%annotation;)?>
351
+ <!ATTLIST %include;
352
+ schemaLocation %URIref; #REQUIRED
353
+ id ID #IMPLIED
354
+ %includeAttrs;>
355
+
356
+ <!ELEMENT %import; (%annotation;)?>
357
+ <!ATTLIST %import;
358
+ namespace %URIref; #IMPLIED
359
+ schemaLocation %URIref; #IMPLIED
360
+ id ID #IMPLIED
361
+ %importAttrs;>
362
+
363
+ <!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
364
+ %attributeGroup; | %group;)*>
365
+ <!ATTLIST %redefine;
366
+ schemaLocation %URIref; #REQUIRED
367
+ id ID #IMPLIED
368
+ %redefineAttrs;>
369
+
370
+ <!ELEMENT %notation; (%annotation;)?>
371
+ <!ATTLIST %notation;
372
+ name %NCName; #REQUIRED
373
+ id ID #IMPLIED
374
+ public CDATA #REQUIRED
375
+ system %URIref; #IMPLIED
376
+ %notationAttrs;>
377
+
378
+ <!-- Annotation is either application information or documentation -->
379
+ <!-- By having these here they are available for datatypes as well
380
+ as all the structures elements -->
381
+
382
+ <!ELEMENT %annotation; (%appinfo; | %documentation;)*>
383
+ <!ATTLIST %annotation; %annotationAttrs;>
384
+
385
+ <!-- User must define annotation elements in internal subset for this
386
+ to work -->
387
+ <!ELEMENT %appinfo; ANY> <!-- too restrictive -->
388
+ <!ATTLIST %appinfo;
389
+ source %URIref; #IMPLIED
390
+ id ID #IMPLIED
391
+ %appinfoAttrs;>
392
+ <!ELEMENT %documentation; ANY> <!-- too restrictive -->
393
+ <!ATTLIST %documentation;
394
+ source %URIref; #IMPLIED
395
+ id ID #IMPLIED
396
+ xml:lang CDATA #IMPLIED
397
+ %documentationAttrs;>
398
+
399
+ <!NOTATION XMLSchemaStructures PUBLIC
400
+ 'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
401
+ <!NOTATION XML PUBLIC
402
+ 'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >