cdk-comprehend-s3olap 2.0.120 → 2.0.122

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 (79) hide show
  1. package/.jsii +4 -4
  2. package/lib/cdk-comprehend-s3olap.js +2 -2
  3. package/lib/comprehend-lambdas.js +2 -2
  4. package/lib/iam-roles.js +4 -4
  5. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  6. package/node_modules/@esbuild/linux-x64/package.json +1 -1
  7. package/node_modules/aws-sdk/CHANGELOG.md +9 -1
  8. package/node_modules/aws-sdk/README.md +1 -1
  9. package/node_modules/aws-sdk/apis/connect-2017-08-08.min.json +196 -187
  10. package/node_modules/aws-sdk/apis/marketplace-catalog-2018-09-17.min.json +82 -15
  11. package/node_modules/aws-sdk/apis/mediaconvert-2017-08-29.min.json +56 -32
  12. package/node_modules/aws-sdk/apis/rekognition-2016-06-27.min.json +224 -138
  13. package/node_modules/aws-sdk/clients/connect.d.ts +15 -4
  14. package/node_modules/aws-sdk/clients/ecs.d.ts +24 -24
  15. package/node_modules/aws-sdk/clients/marketplacecatalog.d.ts +67 -7
  16. package/node_modules/aws-sdk/clients/mediaconvert.d.ts +20 -1
  17. package/node_modules/aws-sdk/clients/omics.d.ts +2 -2
  18. package/node_modules/aws-sdk/clients/rekognition.d.ts +114 -16
  19. package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +1 -1
  20. package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +2532 -875
  21. package/node_modules/aws-sdk/dist/aws-sdk.js +505 -343
  22. package/node_modules/aws-sdk/dist/aws-sdk.min.js +79 -79
  23. package/node_modules/aws-sdk/dist/xml2js.js +2579 -922
  24. package/node_modules/aws-sdk/lib/core.js +1 -1
  25. package/node_modules/aws-sdk/package.json +2 -2
  26. package/node_modules/esbuild/bin/esbuild +1 -1
  27. package/node_modules/esbuild/lib/main.js +8 -8
  28. package/node_modules/esbuild/package.json +23 -23
  29. package/node_modules/xml2js/README.md +108 -7
  30. package/node_modules/xml2js/lib/parser.js +35 -7
  31. package/node_modules/xml2js/lib/xml2js.js +2 -0
  32. package/node_modules/xml2js/node_modules/xmlbuilder/CHANGELOG.md +47 -0
  33. package/node_modules/xml2js/node_modules/xmlbuilder/LICENSE +21 -21
  34. package/node_modules/xml2js/node_modules/xmlbuilder/README.md +86 -85
  35. package/node_modules/xml2js/node_modules/xmlbuilder/appveyor.yml +20 -0
  36. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Derivation.js +10 -0
  37. package/node_modules/xml2js/node_modules/xmlbuilder/lib/DocumentPosition.js +12 -0
  38. package/node_modules/xml2js/node_modules/xmlbuilder/lib/NodeType.js +23 -0
  39. package/node_modules/xml2js/node_modules/xmlbuilder/lib/OperationType.js +11 -0
  40. package/node_modules/xml2js/node_modules/xmlbuilder/lib/Utility.js +11 -1
  41. package/node_modules/xml2js/node_modules/xmlbuilder/lib/WriterState.js +10 -0
  42. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLAttribute.js +86 -9
  43. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCData.js +10 -6
  44. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCharacterData.js +79 -0
  45. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLComment.js +10 -6
  46. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js +64 -0
  47. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js +16 -0
  48. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMImplementation.js +32 -0
  49. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMStringList.js +28 -0
  50. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDAttList.js +16 -11
  51. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDElement.js +7 -4
  52. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDEntity.js +49 -8
  53. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDNotation.js +20 -5
  54. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDeclaration.js +5 -2
  55. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocType.js +84 -5
  56. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocument.js +199 -5
  57. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentCB.js +165 -39
  58. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentFragment.js +24 -0
  59. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDummy.js +31 -0
  60. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLElement.js +207 -20
  61. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js +58 -0
  62. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNode.js +403 -50
  63. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeFilter.js +48 -0
  64. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeList.js +28 -0
  65. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +19 -5
  66. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLRaw.js +6 -3
  67. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStreamWriter.js +94 -197
  68. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringWriter.js +6 -305
  69. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringifier.js +109 -32
  70. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLText.js +43 -6
  71. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLTypeInfo.js +21 -0
  72. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLUserDataHandler.js +16 -0
  73. package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLWriterBase.js +397 -59
  74. package/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js +15 -3
  75. package/node_modules/xml2js/node_modules/xmlbuilder/package.json +5 -3
  76. package/node_modules/xml2js/node_modules/xmlbuilder/typings/index.d.ts +153 -0
  77. package/node_modules/xml2js/package.json +11 -5
  78. package/package.json +5 -5
  79. package/node_modules/xml2js/node_modules/xmlbuilder/.npmignore +0 -5
@@ -1,33 +1,9 @@
1
1
  // Generated by CoffeeScript 1.12.7
2
2
  (function() {
3
- var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLText, XMLWriterBase,
3
+ var XMLStringWriter, XMLWriterBase,
4
4
  extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
5
5
  hasProp = {}.hasOwnProperty;
6
6
 
7
- XMLDeclaration = require('./XMLDeclaration');
8
-
9
- XMLDocType = require('./XMLDocType');
10
-
11
- XMLCData = require('./XMLCData');
12
-
13
- XMLComment = require('./XMLComment');
14
-
15
- XMLElement = require('./XMLElement');
16
-
17
- XMLRaw = require('./XMLRaw');
18
-
19
- XMLText = require('./XMLText');
20
-
21
- XMLProcessingInstruction = require('./XMLProcessingInstruction');
22
-
23
- XMLDTDAttList = require('./XMLDTDAttList');
24
-
25
- XMLDTDElement = require('./XMLDTDElement');
26
-
27
- XMLDTDEntity = require('./XMLDTDEntity');
28
-
29
- XMLDTDNotation = require('./XMLDTDNotation');
30
-
31
7
  XMLWriterBase = require('./XMLWriterBase');
32
8
 
33
9
  module.exports = XMLStringWriter = (function(superClass) {
@@ -37,296 +13,21 @@
37
13
  XMLStringWriter.__super__.constructor.call(this, options);
38
14
  }
39
15
 
40
- XMLStringWriter.prototype.document = function(doc) {
16
+ XMLStringWriter.prototype.document = function(doc, options) {
41
17
  var child, i, len, r, ref;
42
- this.textispresent = false;
18
+ options = this.filterOptions(options);
43
19
  r = '';
44
20
  ref = doc.children;
45
21
  for (i = 0, len = ref.length; i < len; i++) {
46
22
  child = ref[i];
47
- r += (function() {
48
- switch (false) {
49
- case !(child instanceof XMLDeclaration):
50
- return this.declaration(child);
51
- case !(child instanceof XMLDocType):
52
- return this.docType(child);
53
- case !(child instanceof XMLComment):
54
- return this.comment(child);
55
- case !(child instanceof XMLProcessingInstruction):
56
- return this.processingInstruction(child);
57
- default:
58
- return this.element(child, 0);
59
- }
60
- }).call(this);
61
- }
62
- if (this.pretty && r.slice(-this.newline.length) === this.newline) {
63
- r = r.slice(0, -this.newline.length);
64
- }
65
- return r;
66
- };
67
-
68
- XMLStringWriter.prototype.attribute = function(att) {
69
- return ' ' + att.name + '="' + att.value + '"';
70
- };
71
-
72
- XMLStringWriter.prototype.cdata = function(node, level) {
73
- return this.space(level) + '<![CDATA[' + node.text + ']]>' + this.newline;
74
- };
75
-
76
- XMLStringWriter.prototype.comment = function(node, level) {
77
- return this.space(level) + '<!-- ' + node.text + ' -->' + this.newline;
78
- };
79
-
80
- XMLStringWriter.prototype.declaration = function(node, level) {
81
- var r;
82
- r = this.space(level);
83
- r += '<?xml version="' + node.version + '"';
84
- if (node.encoding != null) {
85
- r += ' encoding="' + node.encoding + '"';
86
- }
87
- if (node.standalone != null) {
88
- r += ' standalone="' + node.standalone + '"';
89
- }
90
- r += this.spacebeforeslash + '?>';
91
- r += this.newline;
92
- return r;
93
- };
94
-
95
- XMLStringWriter.prototype.docType = function(node, level) {
96
- var child, i, len, r, ref;
97
- level || (level = 0);
98
- r = this.space(level);
99
- r += '<!DOCTYPE ' + node.root().name;
100
- if (node.pubID && node.sysID) {
101
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
102
- } else if (node.sysID) {
103
- r += ' SYSTEM "' + node.sysID + '"';
104
- }
105
- if (node.children.length > 0) {
106
- r += ' [';
107
- r += this.newline;
108
- ref = node.children;
109
- for (i = 0, len = ref.length; i < len; i++) {
110
- child = ref[i];
111
- r += (function() {
112
- switch (false) {
113
- case !(child instanceof XMLDTDAttList):
114
- return this.dtdAttList(child, level + 1);
115
- case !(child instanceof XMLDTDElement):
116
- return this.dtdElement(child, level + 1);
117
- case !(child instanceof XMLDTDEntity):
118
- return this.dtdEntity(child, level + 1);
119
- case !(child instanceof XMLDTDNotation):
120
- return this.dtdNotation(child, level + 1);
121
- case !(child instanceof XMLCData):
122
- return this.cdata(child, level + 1);
123
- case !(child instanceof XMLComment):
124
- return this.comment(child, level + 1);
125
- case !(child instanceof XMLProcessingInstruction):
126
- return this.processingInstruction(child, level + 1);
127
- default:
128
- throw new Error("Unknown DTD node type: " + child.constructor.name);
129
- }
130
- }).call(this);
131
- }
132
- r += ']';
133
- }
134
- r += this.spacebeforeslash + '>';
135
- r += this.newline;
136
- return r;
137
- };
138
-
139
- XMLStringWriter.prototype.element = function(node, level) {
140
- var att, child, i, j, len, len1, name, r, ref, ref1, ref2, space, textispresentwasset;
141
- level || (level = 0);
142
- textispresentwasset = false;
143
- if (this.textispresent) {
144
- this.newline = '';
145
- this.pretty = false;
146
- } else {
147
- this.newline = this.newlinedefault;
148
- this.pretty = this.prettydefault;
149
- }
150
- space = this.space(level);
151
- r = '';
152
- r += space + '<' + node.name;
153
- ref = node.attributes;
154
- for (name in ref) {
155
- if (!hasProp.call(ref, name)) continue;
156
- att = ref[name];
157
- r += this.attribute(att);
23
+ r += this.writeChildNode(child, options, 0);
158
24
  }
159
- if (node.children.length === 0 || node.children.every(function(e) {
160
- return e.value === '';
161
- })) {
162
- if (this.allowEmpty) {
163
- r += '></' + node.name + '>' + this.newline;
164
- } else {
165
- r += this.spacebeforeslash + '/>' + this.newline;
166
- }
167
- } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) {
168
- r += '>';
169
- r += node.children[0].value;
170
- r += '</' + node.name + '>' + this.newline;
171
- } else {
172
- if (this.dontprettytextnodes) {
173
- ref1 = node.children;
174
- for (i = 0, len = ref1.length; i < len; i++) {
175
- child = ref1[i];
176
- if (child.value != null) {
177
- this.textispresent++;
178
- textispresentwasset = true;
179
- break;
180
- }
181
- }
182
- }
183
- if (this.textispresent) {
184
- this.newline = '';
185
- this.pretty = false;
186
- space = this.space(level);
187
- }
188
- r += '>' + this.newline;
189
- ref2 = node.children;
190
- for (j = 0, len1 = ref2.length; j < len1; j++) {
191
- child = ref2[j];
192
- r += (function() {
193
- switch (false) {
194
- case !(child instanceof XMLCData):
195
- return this.cdata(child, level + 1);
196
- case !(child instanceof XMLComment):
197
- return this.comment(child, level + 1);
198
- case !(child instanceof XMLElement):
199
- return this.element(child, level + 1);
200
- case !(child instanceof XMLRaw):
201
- return this.raw(child, level + 1);
202
- case !(child instanceof XMLText):
203
- return this.text(child, level + 1);
204
- case !(child instanceof XMLProcessingInstruction):
205
- return this.processingInstruction(child, level + 1);
206
- default:
207
- throw new Error("Unknown XML node type: " + child.constructor.name);
208
- }
209
- }).call(this);
210
- }
211
- if (textispresentwasset) {
212
- this.textispresent--;
213
- }
214
- if (!this.textispresent) {
215
- this.newline = this.newlinedefault;
216
- this.pretty = this.prettydefault;
217
- }
218
- r += space + '</' + node.name + '>' + this.newline;
25
+ if (options.pretty && r.slice(-options.newline.length) === options.newline) {
26
+ r = r.slice(0, -options.newline.length);
219
27
  }
220
28
  return r;
221
29
  };
222
30
 
223
- XMLStringWriter.prototype.processingInstruction = function(node, level) {
224
- var r;
225
- r = this.space(level) + '<?' + node.target;
226
- if (node.value) {
227
- r += ' ' + node.value;
228
- }
229
- r += this.spacebeforeslash + '?>' + this.newline;
230
- return r;
231
- };
232
-
233
- XMLStringWriter.prototype.raw = function(node, level) {
234
- return this.space(level) + node.value + this.newline;
235
- };
236
-
237
- XMLStringWriter.prototype.text = function(node, level) {
238
- return this.space(level) + node.value + this.newline;
239
- };
240
-
241
- XMLStringWriter.prototype.dtdAttList = function(node, level) {
242
- var r;
243
- r = this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
244
- if (node.defaultValueType !== '#DEFAULT') {
245
- r += ' ' + node.defaultValueType;
246
- }
247
- if (node.defaultValue) {
248
- r += ' "' + node.defaultValue + '"';
249
- }
250
- r += this.spacebeforeslash + '>' + this.newline;
251
- return r;
252
- };
253
-
254
- XMLStringWriter.prototype.dtdElement = function(node, level) {
255
- return this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value + this.spacebeforeslash + '>' + this.newline;
256
- };
257
-
258
- XMLStringWriter.prototype.dtdEntity = function(node, level) {
259
- var r;
260
- r = this.space(level) + '<!ENTITY';
261
- if (node.pe) {
262
- r += ' %';
263
- }
264
- r += ' ' + node.name;
265
- if (node.value) {
266
- r += ' "' + node.value + '"';
267
- } else {
268
- if (node.pubID && node.sysID) {
269
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
270
- } else if (node.sysID) {
271
- r += ' SYSTEM "' + node.sysID + '"';
272
- }
273
- if (node.nData) {
274
- r += ' NDATA ' + node.nData;
275
- }
276
- }
277
- r += this.spacebeforeslash + '>' + this.newline;
278
- return r;
279
- };
280
-
281
- XMLStringWriter.prototype.dtdNotation = function(node, level) {
282
- var r;
283
- r = this.space(level) + '<!NOTATION ' + node.name;
284
- if (node.pubID && node.sysID) {
285
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
286
- } else if (node.pubID) {
287
- r += ' PUBLIC "' + node.pubID + '"';
288
- } else if (node.sysID) {
289
- r += ' SYSTEM "' + node.sysID + '"';
290
- }
291
- r += this.spacebeforeslash + '>' + this.newline;
292
- return r;
293
- };
294
-
295
- XMLStringWriter.prototype.openNode = function(node, level) {
296
- var att, name, r, ref;
297
- level || (level = 0);
298
- if (node instanceof XMLElement) {
299
- r = this.space(level) + '<' + node.name;
300
- ref = node.attributes;
301
- for (name in ref) {
302
- if (!hasProp.call(ref, name)) continue;
303
- att = ref[name];
304
- r += this.attribute(att);
305
- }
306
- r += (node.children ? '>' : '/>') + this.newline;
307
- return r;
308
- } else {
309
- r = this.space(level) + '<!DOCTYPE ' + node.rootNodeName;
310
- if (node.pubID && node.sysID) {
311
- r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
312
- } else if (node.sysID) {
313
- r += ' SYSTEM "' + node.sysID + '"';
314
- }
315
- r += (node.children ? ' [' : '>') + this.newline;
316
- return r;
317
- }
318
- };
319
-
320
- XMLStringWriter.prototype.closeNode = function(node, level) {
321
- level || (level = 0);
322
- switch (false) {
323
- case !(node instanceof XMLElement):
324
- return this.space(level) + '</' + node.name + '>' + this.newline;
325
- case !(node instanceof XMLDocType):
326
- return this.space(level) + ']>' + this.newline;
327
- }
328
- };
329
-
330
31
  return XMLStringWriter;
331
32
 
332
33
  })(XMLWriterBase);
@@ -6,10 +6,14 @@
6
6
 
7
7
  module.exports = XMLStringifier = (function() {
8
8
  function XMLStringifier(options) {
9
+ this.assertLegalName = bind(this.assertLegalName, this);
9
10
  this.assertLegalChar = bind(this.assertLegalChar, this);
10
11
  var key, ref, value;
11
12
  options || (options = {});
12
- this.noDoubleEncoding = options.noDoubleEncoding;
13
+ this.options = options;
14
+ if (!this.options.version) {
15
+ this.options.version = '1.0';
16
+ }
13
17
  ref = options.stringify || {};
14
18
  for (key in ref) {
15
19
  if (!hasProp.call(ref, key)) continue;
@@ -18,23 +22,33 @@
18
22
  }
19
23
  }
20
24
 
21
- XMLStringifier.prototype.eleName = function(val) {
22
- val = '' + val || '';
23
- return this.assertLegalChar(val);
25
+ XMLStringifier.prototype.name = function(val) {
26
+ if (this.options.noValidation) {
27
+ return val;
28
+ }
29
+ return this.assertLegalName('' + val || '');
24
30
  };
25
31
 
26
- XMLStringifier.prototype.eleText = function(val) {
27
- val = '' + val || '';
28
- return this.assertLegalChar(this.elEscape(val));
32
+ XMLStringifier.prototype.text = function(val) {
33
+ if (this.options.noValidation) {
34
+ return val;
35
+ }
36
+ return this.assertLegalChar(this.textEscape('' + val || ''));
29
37
  };
30
38
 
31
39
  XMLStringifier.prototype.cdata = function(val) {
40
+ if (this.options.noValidation) {
41
+ return val;
42
+ }
32
43
  val = '' + val || '';
33
44
  val = val.replace(']]>', ']]]]><![CDATA[>');
34
45
  return this.assertLegalChar(val);
35
46
  };
36
47
 
37
48
  XMLStringifier.prototype.comment = function(val) {
49
+ if (this.options.noValidation) {
50
+ return val;
51
+ }
38
52
  val = '' + val || '';
39
53
  if (val.match(/--/)) {
40
54
  throw new Error("Comment text cannot contain double-hypen: " + val);
@@ -43,31 +57,41 @@
43
57
  };
44
58
 
45
59
  XMLStringifier.prototype.raw = function(val) {
60
+ if (this.options.noValidation) {
61
+ return val;
62
+ }
46
63
  return '' + val || '';
47
64
  };
48
65
 
49
- XMLStringifier.prototype.attName = function(val) {
50
- return val = '' + val || '';
51
- };
52
-
53
66
  XMLStringifier.prototype.attValue = function(val) {
54
- val = '' + val || '';
55
- return this.attEscape(val);
67
+ if (this.options.noValidation) {
68
+ return val;
69
+ }
70
+ return this.assertLegalChar(this.attEscape(val = '' + val || ''));
56
71
  };
57
72
 
58
73
  XMLStringifier.prototype.insTarget = function(val) {
59
- return '' + val || '';
74
+ if (this.options.noValidation) {
75
+ return val;
76
+ }
77
+ return this.assertLegalChar('' + val || '');
60
78
  };
61
79
 
62
80
  XMLStringifier.prototype.insValue = function(val) {
81
+ if (this.options.noValidation) {
82
+ return val;
83
+ }
63
84
  val = '' + val || '';
64
85
  if (val.match(/\?>/)) {
65
86
  throw new Error("Invalid processing instruction value: " + val);
66
87
  }
67
- return val;
88
+ return this.assertLegalChar(val);
68
89
  };
69
90
 
70
91
  XMLStringifier.prototype.xmlVersion = function(val) {
92
+ if (this.options.noValidation) {
93
+ return val;
94
+ }
71
95
  val = '' + val || '';
72
96
  if (!val.match(/1\.[0-9]+/)) {
73
97
  throw new Error("Invalid version number: " + val);
@@ -76,14 +100,20 @@
76
100
  };
77
101
 
78
102
  XMLStringifier.prototype.xmlEncoding = function(val) {
103
+ if (this.options.noValidation) {
104
+ return val;
105
+ }
79
106
  val = '' + val || '';
80
107
  if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
81
108
  throw new Error("Invalid encoding: " + val);
82
109
  }
83
- return val;
110
+ return this.assertLegalChar(val);
84
111
  };
85
112
 
86
113
  XMLStringifier.prototype.xmlStandalone = function(val) {
114
+ if (this.options.noValidation) {
115
+ return val;
116
+ }
87
117
  if (val) {
88
118
  return "yes";
89
119
  } else {
@@ -92,35 +122,52 @@
92
122
  };
93
123
 
94
124
  XMLStringifier.prototype.dtdPubID = function(val) {
95
- return '' + val || '';
125
+ if (this.options.noValidation) {
126
+ return val;
127
+ }
128
+ return this.assertLegalChar('' + val || '');
96
129
  };
97
130
 
98
131
  XMLStringifier.prototype.dtdSysID = function(val) {
99
- return '' + val || '';
132
+ if (this.options.noValidation) {
133
+ return val;
134
+ }
135
+ return this.assertLegalChar('' + val || '');
100
136
  };
101
137
 
102
138
  XMLStringifier.prototype.dtdElementValue = function(val) {
103
- return '' + val || '';
139
+ if (this.options.noValidation) {
140
+ return val;
141
+ }
142
+ return this.assertLegalChar('' + val || '');
104
143
  };
105
144
 
106
145
  XMLStringifier.prototype.dtdAttType = function(val) {
107
- return '' + val || '';
146
+ if (this.options.noValidation) {
147
+ return val;
148
+ }
149
+ return this.assertLegalChar('' + val || '');
108
150
  };
109
151
 
110
152
  XMLStringifier.prototype.dtdAttDefault = function(val) {
111
- if (val != null) {
112
- return '' + val || '';
113
- } else {
153
+ if (this.options.noValidation) {
114
154
  return val;
115
155
  }
156
+ return this.assertLegalChar('' + val || '');
116
157
  };
117
158
 
118
159
  XMLStringifier.prototype.dtdEntityValue = function(val) {
119
- return '' + val || '';
160
+ if (this.options.noValidation) {
161
+ return val;
162
+ }
163
+ return this.assertLegalChar('' + val || '');
120
164
  };
121
165
 
122
166
  XMLStringifier.prototype.dtdNData = function(val) {
123
- return '' + val || '';
167
+ if (this.options.noValidation) {
168
+ return val;
169
+ }
170
+ return this.assertLegalChar('' + val || '');
124
171
  };
125
172
 
126
173
  XMLStringifier.prototype.convertAttKey = '@';
@@ -136,23 +183,53 @@
136
183
  XMLStringifier.prototype.convertRawKey = '#raw';
137
184
 
138
185
  XMLStringifier.prototype.assertLegalChar = function(str) {
139
- var res;
140
- res = str.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);
141
- if (res) {
142
- throw new Error("Invalid character in string: " + str + " at index " + res.index);
186
+ var regex, res;
187
+ if (this.options.noValidation) {
188
+ return str;
189
+ }
190
+ regex = '';
191
+ if (this.options.version === '1.0') {
192
+ regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
193
+ if (res = str.match(regex)) {
194
+ throw new Error("Invalid character in string: " + str + " at index " + res.index);
195
+ }
196
+ } else if (this.options.version === '1.1') {
197
+ regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
198
+ if (res = str.match(regex)) {
199
+ throw new Error("Invalid character in string: " + str + " at index " + res.index);
200
+ }
143
201
  }
144
202
  return str;
145
203
  };
146
204
 
147
- XMLStringifier.prototype.elEscape = function(str) {
205
+ XMLStringifier.prototype.assertLegalName = function(str) {
206
+ var regex;
207
+ if (this.options.noValidation) {
208
+ return str;
209
+ }
210
+ this.assertLegalChar(str);
211
+ regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
212
+ if (!str.match(regex)) {
213
+ throw new Error("Invalid character in name");
214
+ }
215
+ return str;
216
+ };
217
+
218
+ XMLStringifier.prototype.textEscape = function(str) {
148
219
  var ampregex;
149
- ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
220
+ if (this.options.noValidation) {
221
+ return str;
222
+ }
223
+ ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
150
224
  return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
151
225
  };
152
226
 
153
227
  XMLStringifier.prototype.attEscape = function(str) {
154
228
  var ampregex;
155
- ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
229
+ if (this.options.noValidation) {
230
+ return str;
231
+ }
232
+ ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
156
233
  return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
157
234
  };
158
235
 
@@ -1,10 +1,12 @@
1
1
  // Generated by CoffeeScript 1.12.7
2
2
  (function() {
3
- var XMLNode, XMLText,
3
+ var NodeType, XMLCharacterData, XMLText,
4
4
  extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
5
5
  hasProp = {}.hasOwnProperty;
6
6
 
7
- XMLNode = require('./XMLNode');
7
+ NodeType = require('./NodeType');
8
+
9
+ XMLCharacterData = require('./XMLCharacterData');
8
10
 
9
11
  module.exports = XMLText = (function(superClass) {
10
12
  extend(XMLText, superClass);
@@ -12,21 +14,56 @@
12
14
  function XMLText(parent, text) {
13
15
  XMLText.__super__.constructor.call(this, parent);
14
16
  if (text == null) {
15
- throw new Error("Missing element text");
17
+ throw new Error("Missing element text. " + this.debugInfo());
16
18
  }
17
- this.value = this.stringify.eleText(text);
19
+ this.name = "#text";
20
+ this.type = NodeType.Text;
21
+ this.value = this.stringify.text(text);
18
22
  }
19
23
 
24
+ Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
25
+ get: function() {
26
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
27
+ }
28
+ });
29
+
30
+ Object.defineProperty(XMLText.prototype, 'wholeText', {
31
+ get: function() {
32
+ var next, prev, str;
33
+ str = '';
34
+ prev = this.previousSibling;
35
+ while (prev) {
36
+ str = prev.data + str;
37
+ prev = prev.previousSibling;
38
+ }
39
+ str += this.data;
40
+ next = this.nextSibling;
41
+ while (next) {
42
+ str = str + next.data;
43
+ next = next.nextSibling;
44
+ }
45
+ return str;
46
+ }
47
+ });
48
+
20
49
  XMLText.prototype.clone = function() {
21
50
  return Object.create(this);
22
51
  };
23
52
 
24
53
  XMLText.prototype.toString = function(options) {
25
- return this.options.writer.set(options).text(this);
54
+ return this.options.writer.text(this, this.options.writer.filterOptions(options));
55
+ };
56
+
57
+ XMLText.prototype.splitText = function(offset) {
58
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
59
+ };
60
+
61
+ XMLText.prototype.replaceWholeText = function(content) {
62
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
26
63
  };
27
64
 
28
65
  return XMLText;
29
66
 
30
- })(XMLNode);
67
+ })(XMLCharacterData);
31
68
 
32
69
  }).call(this);
@@ -0,0 +1,21 @@
1
+ // Generated by CoffeeScript 1.12.7
2
+ (function() {
3
+ var Derivation, XMLTypeInfo;
4
+
5
+ Derivation = require('./Derivation');
6
+
7
+ module.exports = XMLTypeInfo = (function() {
8
+ function XMLTypeInfo(typeName, typeNamespace) {
9
+ this.typeName = typeName;
10
+ this.typeNamespace = typeNamespace;
11
+ }
12
+
13
+ XMLTypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {
14
+ throw new Error("This DOM method is not implemented.");
15
+ };
16
+
17
+ return XMLTypeInfo;
18
+
19
+ })();
20
+
21
+ }).call(this);