samlesa 2.16.6 → 2.17.1

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.

Potentially problematic release.


This version of samlesa might be problematic. Click here for more details.

Files changed (82) hide show
  1. package/README.md +30 -50
  2. package/build/index.js +2 -1
  3. package/build/src/binding-artifact.js +330 -146
  4. package/build/src/binding-post.js +45 -31
  5. package/build/src/binding-redirect.js +0 -10
  6. package/build/src/binding-simplesign.js +0 -1
  7. package/build/src/entity-idp.js +1 -5
  8. package/build/src/entity-sp.js +21 -96
  9. package/build/src/extractor.js +48 -4
  10. package/build/src/flow.js +24 -166
  11. package/build/src/libsaml.js +468 -264
  12. package/build/src/libsamlSoap.js +115 -0
  13. package/build/src/schema/xml.xsd +88 -88
  14. package/build/src/schemaValidator.js +5 -13
  15. package/build/src/soap.js +123 -3
  16. package/build/src/utility.js +12 -7
  17. package/package.json +77 -81
  18. package/types/api.d.ts +15 -0
  19. package/types/api.d.ts.map +1 -0
  20. package/types/binding-post.d.ts +48 -0
  21. package/types/binding-post.d.ts.map +1 -0
  22. package/types/binding-redirect.d.ts +54 -0
  23. package/types/binding-redirect.d.ts.map +1 -0
  24. package/types/binding-simplesign.d.ts +41 -0
  25. package/types/binding-simplesign.d.ts.map +1 -0
  26. package/types/entity-idp.d.ts +38 -0
  27. package/types/entity-idp.d.ts.map +1 -0
  28. package/types/entity-sp.d.ts +38 -0
  29. package/types/entity-sp.d.ts.map +1 -0
  30. package/types/entity.d.ts +100 -0
  31. package/types/entity.d.ts.map +1 -0
  32. package/types/extractor.d.ts +26 -0
  33. package/types/extractor.d.ts.map +1 -0
  34. package/types/flow.d.ts +7 -0
  35. package/types/flow.d.ts.map +1 -0
  36. package/types/index.d.ts +2 -1
  37. package/types/index.d.ts.map +1 -1
  38. package/types/libsaml.d.ts +208 -0
  39. package/types/libsaml.d.ts.map +1 -0
  40. package/types/metadata-idp.d.ts +25 -0
  41. package/types/metadata-idp.d.ts.map +1 -0
  42. package/types/metadata-sp.d.ts +37 -0
  43. package/types/metadata-sp.d.ts.map +1 -0
  44. package/types/metadata.d.ts +58 -0
  45. package/types/metadata.d.ts.map +1 -0
  46. package/types/src/api.d.ts +3 -3
  47. package/types/src/api.d.ts.map +1 -1
  48. package/types/src/binding-artifact.d.ts +24 -29
  49. package/types/src/binding-artifact.d.ts.map +1 -1
  50. package/types/src/binding-post.d.ts +22 -22
  51. package/types/src/binding-post.d.ts.map +1 -1
  52. package/types/src/binding-redirect.d.ts.map +1 -1
  53. package/types/src/binding-simplesign.d.ts.map +1 -1
  54. package/types/src/entity-idp.d.ts +3 -4
  55. package/types/src/entity-idp.d.ts.map +1 -1
  56. package/types/src/entity-sp.d.ts +13 -24
  57. package/types/src/entity-sp.d.ts.map +1 -1
  58. package/types/src/entity.d.ts.map +1 -1
  59. package/types/src/extractor.d.ts +22 -0
  60. package/types/src/extractor.d.ts.map +1 -1
  61. package/types/src/flow.d.ts +1 -0
  62. package/types/src/flow.d.ts.map +1 -1
  63. package/types/src/libsaml.d.ts +16 -7
  64. package/types/src/libsaml.d.ts.map +1 -1
  65. package/types/src/libsamlSoap.d.ts +7 -0
  66. package/types/src/libsamlSoap.d.ts.map +1 -0
  67. package/types/src/schemaValidator.d.ts +1 -1
  68. package/types/src/schemaValidator.d.ts.map +1 -1
  69. package/types/src/soap.d.ts +33 -0
  70. package/types/src/soap.d.ts.map +1 -1
  71. package/types/src/utility.d.ts.map +1 -1
  72. package/types/src/validator.d.ts.map +1 -1
  73. package/types/types.d.ts +128 -0
  74. package/types/types.d.ts.map +1 -0
  75. package/types/urn.d.ts +195 -0
  76. package/types/urn.d.ts.map +1 -0
  77. package/types/utility.d.ts +133 -0
  78. package/types/utility.d.ts.map +1 -0
  79. package/types/validator.d.ts +4 -0
  80. package/types/validator.d.ts.map +1 -0
  81. package/build/src/schema/XMLSchema.dtd +0 -402
  82. package/build/src/schema/datatypes.dtd +0 -203
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @file utility.ts
3
+ * @author tngan
4
+ * @desc Library for some common functions (e.g. de/inflation, en/decoding)
5
+ */
6
+ /**
7
+ * @desc Mimic lodash.zipObject
8
+ * @param arr1 {string[]}
9
+ * @param arr2 {[]}
10
+ */
11
+ export declare function zipObject(arr1: string[], arr2: any[], skipDuplicated?: boolean): {};
12
+ /**
13
+ * @desc Alternative to lodash.flattenDeep
14
+ * @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_flattendeep
15
+ * @param input {[]}
16
+ */
17
+ export declare function flattenDeep(input: any[]): any;
18
+ /**
19
+ * @desc Alternative to lodash.last
20
+ * @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_last
21
+ * @param input {[]}
22
+ */
23
+ export declare function last(input: any[]): any;
24
+ /**
25
+ * @desc Alternative to lodash.uniq
26
+ * @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_uniq
27
+ * @param input {string[]}
28
+ */
29
+ export declare function uniq(input: string[]): string[];
30
+ /**
31
+ * @desc Alternative to lodash.get
32
+ * @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get
33
+ * @param obj
34
+ * @param path
35
+ * @param defaultValue
36
+ */
37
+ export declare function get(obj: any, path: any, defaultValue: any): any;
38
+ /**
39
+ * @desc Check if the input is string
40
+ * @param {any} input
41
+ */
42
+ export declare function isString(input: any): input is string;
43
+ /**
44
+ * @desc Encode string with base64 format
45
+ * @param {string} message plain-text message
46
+ * @return {string} base64 encoded string
47
+ */
48
+ declare function base64Encode(message: string | number[]): string;
49
+ /**
50
+ * @desc Decode string from base64 format
51
+ * @param {string} base64Message encoded string
52
+ * @param {boolean} isBytes determine the return value type (True: bytes False: string)
53
+ * @return {bytes/string} decoded bytes/string depends on isBytes, default is {string}
54
+ */
55
+ export declare function base64Decode(base64Message: string, isBytes?: boolean): string | Buffer;
56
+ /**
57
+ * @desc Compress the string
58
+ * @param {string} message
59
+ * @return {string} compressed string
60
+ */
61
+ declare function deflateString(message: string): number[];
62
+ /**
63
+ * @desc Decompress the compressed string
64
+ * @param {string} compressedString
65
+ * @return {string} decompressed string
66
+ */
67
+ export declare function inflateString(compressedString: string): string;
68
+ /**
69
+ * @desc Parse the .cer to string format without line break, header and footer
70
+ * @param {string} certString declares the certificate contents
71
+ * @return {string} certificiate in string format
72
+ */
73
+ declare function normalizeCerString(certString: string | Buffer): string;
74
+ /**
75
+ * @desc Normalize the string in .pem format without line break, header and footer
76
+ * @param {string} pemString
77
+ * @return {string} private key in string format
78
+ */
79
+ declare function normalizePemString(pemString: string | Buffer): string;
80
+ /**
81
+ * @desc Return the complete URL
82
+ * @param {object} req HTTP request
83
+ * @return {string} URL
84
+ */
85
+ declare function getFullURL(req: any): string;
86
+ /**
87
+ * @desc Parse input string, return default value if it is undefined
88
+ * @param {string/boolean}
89
+ * @return {boolean}
90
+ */
91
+ declare function parseString(str: any, defaultValue?: string): any;
92
+ /**
93
+ * @desc Override the object by another object (rtl)
94
+ * @param {object} default object
95
+ * @param {object} object applied to the default object
96
+ * @return {object} result object
97
+ */
98
+ declare function applyDefault(obj1: any, obj2: any): any;
99
+ /**
100
+ * @desc Get public key in pem format from the certificate included in the metadata
101
+ * @param {string} x509 certificate
102
+ * @return {string} public key fetched from the certificate
103
+ */
104
+ declare function getPublicKeyPemFromCertificate(x509CertificateString: string): string | Buffer<ArrayBufferLike>;
105
+ export declare function readPrivateKey(keyString: string | Buffer, passphrase?: string, isOutputString?: boolean): string | Buffer;
106
+ /**
107
+ * @desc Inline syntax sugar
108
+ */
109
+ declare function convertToString(input: any, isOutputString: any): any;
110
+ /**
111
+ * @desc Check if the input is an array with non-zero size
112
+ */
113
+ export declare function isNonEmptyArray(a: any): boolean;
114
+ export declare function castArrayOpt<T>(a?: T | T[]): T[];
115
+ export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue;
116
+ declare const utility: {
117
+ isString: typeof isString;
118
+ base64Encode: typeof base64Encode;
119
+ base64Decode: typeof base64Decode;
120
+ deflateString: typeof deflateString;
121
+ inflateString: typeof inflateString;
122
+ normalizeCerString: typeof normalizeCerString;
123
+ normalizePemString: typeof normalizePemString;
124
+ getFullURL: typeof getFullURL;
125
+ parseString: typeof parseString;
126
+ applyDefault: typeof applyDefault;
127
+ getPublicKeyPemFromCertificate: typeof getPublicKeyPemFromCertificate;
128
+ readPrivateKey: typeof readPrivateKey;
129
+ convertToString: typeof convertToString;
130
+ isNonEmptyArray: typeof isNonEmptyArray;
131
+ };
132
+ export default utility;
133
+ //# sourceMappingURL=utility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,cAAc,UAAO,MAmB3E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAIvC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAEhC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAGnC;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,YAAY,KAAA,OAG1C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,mBAElC;AAED;;;;GAIG;AACH,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,UAE/C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAGtF;AAED;;;;GAIG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGhD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAM9D;AAYD;;;;GAIG;AACH,iBAAS,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,UAEtD;AAED;;;;GAIG;AACH,iBAAS,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,UAErD;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,GAAG,KAAA,UAEtB;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,GAAG,KAAA,EAAE,YAAY,SAAK,OAE1C;AAED;;;;;GAKG;AACH,iBAAS,YAAY,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA,OAE/B;AAED;;;;GAIG;AACH,iBAAS,8BAA8B,CAAC,qBAAqB,EAAE,MAAM,oCAWpE;AAqCD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,GAAE,OAAc,GAC7B,MAAM,GAAG,MAAM,CA8BjB;AAGD;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,KAAA,EAAE,cAAc,KAAA,OAE7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,WAErC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAGhD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,CAElF;AAED,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;CAeZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ type DriftTolerance = [number, number];
2
+ declare function verifyTime(utcNotBefore: string | undefined, utcNotOnOrAfter: string | undefined, drift?: DriftTolerance): boolean;
3
+ export { verifyTime };
4
+ //# sourceMappingURL=validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvC,iBAAS,UAAU,CACjB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,KAAK,GAAE,cAAuB,GAC7B,OAAO,CA2BT;AAED,OAAO,EACL,UAAU,EACX,CAAC"}
@@ -1,402 +0,0 @@
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' >