cdk-comprehend-s3olap 2.0.121 → 2.0.123
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.
- package/.jsii +4 -4
- package/lib/cdk-comprehend-s3olap.js +2 -2
- package/lib/comprehend-lambdas.js +2 -2
- package/lib/iam-roles.js +4 -4
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +1 -1
- package/node_modules/aws-sdk/CHANGELOG.md +25 -1
- package/node_modules/aws-sdk/README.md +1 -1
- package/node_modules/aws-sdk/apis/connect-2017-08-08.min.json +196 -187
- package/node_modules/aws-sdk/apis/ecr-public-2020-10-30.min.json +8 -8
- package/node_modules/aws-sdk/apis/emr-serverless-2021-07-13.min.json +3 -0
- package/node_modules/aws-sdk/apis/eventbridge-2015-10-07.min.json +18 -6
- package/node_modules/aws-sdk/apis/iot-data-2015-05-28.min.json +3 -0
- package/node_modules/aws-sdk/apis/marketplace-catalog-2018-09-17.min.json +82 -15
- package/node_modules/aws-sdk/apis/mediaconvert-2017-08-29.min.json +56 -32
- package/node_modules/aws-sdk/apis/rekognition-2016-06-27.min.json +224 -138
- package/node_modules/aws-sdk/apis/wafv2-2019-07-29.min.json +55 -28
- package/node_modules/aws-sdk/clients/connect.d.ts +15 -4
- package/node_modules/aws-sdk/clients/ecrpublic.d.ts +2 -2
- package/node_modules/aws-sdk/clients/ecs.d.ts +24 -24
- package/node_modules/aws-sdk/clients/emrserverless.d.ts +7 -3
- package/node_modules/aws-sdk/clients/eventbridge.d.ts +3 -1
- package/node_modules/aws-sdk/clients/iotdata.d.ts +5 -0
- package/node_modules/aws-sdk/clients/marketplacecatalog.d.ts +67 -7
- package/node_modules/aws-sdk/clients/mediaconvert.d.ts +20 -1
- package/node_modules/aws-sdk/clients/omics.d.ts +2 -2
- package/node_modules/aws-sdk/clients/rekognition.d.ts +114 -16
- package/node_modules/aws-sdk/clients/wafv2.d.ts +89 -62
- package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +1 -1
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +2537 -880
- package/node_modules/aws-sdk/dist/aws-sdk.js +508 -343
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +79 -79
- package/node_modules/aws-sdk/dist/xml2js.js +2579 -922
- package/node_modules/aws-sdk/lib/core.js +1 -1
- package/node_modules/aws-sdk/package.json +2 -2
- package/node_modules/esbuild/bin/esbuild +1 -1
- package/node_modules/esbuild/lib/main.js +8 -8
- package/node_modules/esbuild/package.json +23 -23
- package/node_modules/xml2js/README.md +108 -7
- package/node_modules/xml2js/lib/parser.js +35 -7
- package/node_modules/xml2js/lib/xml2js.js +2 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/CHANGELOG.md +47 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/LICENSE +21 -21
- package/node_modules/xml2js/node_modules/xmlbuilder/README.md +86 -85
- package/node_modules/xml2js/node_modules/xmlbuilder/appveyor.yml +20 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/Derivation.js +10 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/DocumentPosition.js +12 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/NodeType.js +23 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/OperationType.js +11 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/Utility.js +11 -1
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/WriterState.js +10 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLAttribute.js +86 -9
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCData.js +10 -6
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLCharacterData.js +79 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLComment.js +10 -6
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js +64 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js +16 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMImplementation.js +32 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDOMStringList.js +28 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDAttList.js +16 -11
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDElement.js +7 -4
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDEntity.js +49 -8
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDTDNotation.js +20 -5
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDeclaration.js +5 -2
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocType.js +84 -5
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocument.js +199 -5
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentCB.js +165 -39
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDocumentFragment.js +24 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLDummy.js +31 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLElement.js +207 -20
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js +58 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNode.js +403 -50
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeFilter.js +48 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLNodeList.js +28 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +19 -5
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLRaw.js +6 -3
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStreamWriter.js +94 -197
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringWriter.js +6 -305
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLStringifier.js +109 -32
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLText.js +43 -6
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLTypeInfo.js +21 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLUserDataHandler.js +16 -0
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/XMLWriterBase.js +397 -59
- package/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js +15 -3
- package/node_modules/xml2js/node_modules/xmlbuilder/package.json +5 -3
- package/node_modules/xml2js/node_modules/xmlbuilder/typings/index.d.ts +153 -0
- package/node_modules/xml2js/package.json +11 -5
- package/package.json +4 -4
- package/node_modules/xml2js/node_modules/xmlbuilder/.npmignore +0 -5
@@ -1,9 +1,9 @@
|
|
1
1
|
// Generated by CoffeeScript 1.12.7
|
2
2
|
(function() {
|
3
|
-
var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLProcessingInstruction, XMLRaw, XMLText, isEmpty, isFunction, isObject,
|
3
|
+
var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1,
|
4
4
|
hasProp = {}.hasOwnProperty;
|
5
5
|
|
6
|
-
|
6
|
+
ref1 = require('./Utility'), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
|
7
7
|
|
8
8
|
XMLElement = null;
|
9
9
|
|
@@ -21,14 +21,26 @@
|
|
21
21
|
|
22
22
|
XMLProcessingInstruction = null;
|
23
23
|
|
24
|
+
XMLDummy = null;
|
25
|
+
|
26
|
+
NodeType = null;
|
27
|
+
|
28
|
+
XMLNodeList = null;
|
29
|
+
|
30
|
+
XMLNamedNodeMap = null;
|
31
|
+
|
32
|
+
DocumentPosition = null;
|
33
|
+
|
24
34
|
module.exports = XMLNode = (function() {
|
25
|
-
function XMLNode(
|
26
|
-
this.parent =
|
35
|
+
function XMLNode(parent1) {
|
36
|
+
this.parent = parent1;
|
27
37
|
if (this.parent) {
|
28
38
|
this.options = this.parent.options;
|
29
39
|
this.stringify = this.parent.stringify;
|
30
40
|
}
|
41
|
+
this.value = null;
|
31
42
|
this.children = [];
|
43
|
+
this.baseURI = null;
|
32
44
|
if (!XMLElement) {
|
33
45
|
XMLElement = require('./XMLElement');
|
34
46
|
XMLCData = require('./XMLCData');
|
@@ -38,21 +50,134 @@
|
|
38
50
|
XMLRaw = require('./XMLRaw');
|
39
51
|
XMLText = require('./XMLText');
|
40
52
|
XMLProcessingInstruction = require('./XMLProcessingInstruction');
|
53
|
+
XMLDummy = require('./XMLDummy');
|
54
|
+
NodeType = require('./NodeType');
|
55
|
+
XMLNodeList = require('./XMLNodeList');
|
56
|
+
XMLNamedNodeMap = require('./XMLNamedNodeMap');
|
57
|
+
DocumentPosition = require('./DocumentPosition');
|
41
58
|
}
|
42
59
|
}
|
43
60
|
|
61
|
+
Object.defineProperty(XMLNode.prototype, 'nodeName', {
|
62
|
+
get: function() {
|
63
|
+
return this.name;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
Object.defineProperty(XMLNode.prototype, 'nodeType', {
|
68
|
+
get: function() {
|
69
|
+
return this.type;
|
70
|
+
}
|
71
|
+
});
|
72
|
+
|
73
|
+
Object.defineProperty(XMLNode.prototype, 'nodeValue', {
|
74
|
+
get: function() {
|
75
|
+
return this.value;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
|
79
|
+
Object.defineProperty(XMLNode.prototype, 'parentNode', {
|
80
|
+
get: function() {
|
81
|
+
return this.parent;
|
82
|
+
}
|
83
|
+
});
|
84
|
+
|
85
|
+
Object.defineProperty(XMLNode.prototype, 'childNodes', {
|
86
|
+
get: function() {
|
87
|
+
if (!this.childNodeList || !this.childNodeList.nodes) {
|
88
|
+
this.childNodeList = new XMLNodeList(this.children);
|
89
|
+
}
|
90
|
+
return this.childNodeList;
|
91
|
+
}
|
92
|
+
});
|
93
|
+
|
94
|
+
Object.defineProperty(XMLNode.prototype, 'firstChild', {
|
95
|
+
get: function() {
|
96
|
+
return this.children[0] || null;
|
97
|
+
}
|
98
|
+
});
|
99
|
+
|
100
|
+
Object.defineProperty(XMLNode.prototype, 'lastChild', {
|
101
|
+
get: function() {
|
102
|
+
return this.children[this.children.length - 1] || null;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
Object.defineProperty(XMLNode.prototype, 'previousSibling', {
|
107
|
+
get: function() {
|
108
|
+
var i;
|
109
|
+
i = this.parent.children.indexOf(this);
|
110
|
+
return this.parent.children[i - 1] || null;
|
111
|
+
}
|
112
|
+
});
|
113
|
+
|
114
|
+
Object.defineProperty(XMLNode.prototype, 'nextSibling', {
|
115
|
+
get: function() {
|
116
|
+
var i;
|
117
|
+
i = this.parent.children.indexOf(this);
|
118
|
+
return this.parent.children[i + 1] || null;
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
|
123
|
+
get: function() {
|
124
|
+
return this.document() || null;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
|
128
|
+
Object.defineProperty(XMLNode.prototype, 'textContent', {
|
129
|
+
get: function() {
|
130
|
+
var child, j, len, ref2, str;
|
131
|
+
if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
|
132
|
+
str = '';
|
133
|
+
ref2 = this.children;
|
134
|
+
for (j = 0, len = ref2.length; j < len; j++) {
|
135
|
+
child = ref2[j];
|
136
|
+
if (child.textContent) {
|
137
|
+
str += child.textContent;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
return str;
|
141
|
+
} else {
|
142
|
+
return null;
|
143
|
+
}
|
144
|
+
},
|
145
|
+
set: function(value) {
|
146
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
147
|
+
}
|
148
|
+
});
|
149
|
+
|
150
|
+
XMLNode.prototype.setParent = function(parent) {
|
151
|
+
var child, j, len, ref2, results;
|
152
|
+
this.parent = parent;
|
153
|
+
if (parent) {
|
154
|
+
this.options = parent.options;
|
155
|
+
this.stringify = parent.stringify;
|
156
|
+
}
|
157
|
+
ref2 = this.children;
|
158
|
+
results = [];
|
159
|
+
for (j = 0, len = ref2.length; j < len; j++) {
|
160
|
+
child = ref2[j];
|
161
|
+
results.push(child.setParent(this));
|
162
|
+
}
|
163
|
+
return results;
|
164
|
+
};
|
165
|
+
|
44
166
|
XMLNode.prototype.element = function(name, attributes, text) {
|
45
|
-
var childNode, item, j, k, key, lastChild, len, len1,
|
167
|
+
var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
|
46
168
|
lastChild = null;
|
169
|
+
if (attributes === null && (text == null)) {
|
170
|
+
ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
|
171
|
+
}
|
47
172
|
if (attributes == null) {
|
48
173
|
attributes = {};
|
49
174
|
}
|
50
|
-
attributes = attributes
|
175
|
+
attributes = getValue(attributes);
|
51
176
|
if (!isObject(attributes)) {
|
52
|
-
|
177
|
+
ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
|
53
178
|
}
|
54
179
|
if (name != null) {
|
55
|
-
name = name
|
180
|
+
name = getValue(name);
|
56
181
|
}
|
57
182
|
if (Array.isArray(name)) {
|
58
183
|
for (j = 0, len = name.length; j < len; j++) {
|
@@ -68,11 +193,14 @@
|
|
68
193
|
if (isFunction(val)) {
|
69
194
|
val = val.apply();
|
70
195
|
}
|
71
|
-
if ((isObject(val)) && (isEmpty(val))) {
|
72
|
-
val = null;
|
73
|
-
}
|
74
196
|
if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
|
75
197
|
lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
|
198
|
+
} else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
|
199
|
+
lastChild = this.dummy();
|
200
|
+
} else if (isObject(val) && isEmpty(val)) {
|
201
|
+
lastChild = this.element(key);
|
202
|
+
} else if (!this.options.keepNullNodes && (val == null)) {
|
203
|
+
lastChild = this.dummy();
|
76
204
|
} else if (!this.options.separateArrayItems && Array.isArray(val)) {
|
77
205
|
for (k = 0, len1 = val.length; k < len1; k++) {
|
78
206
|
item = val[k];
|
@@ -81,12 +209,18 @@
|
|
81
209
|
lastChild = this.element(childNode);
|
82
210
|
}
|
83
211
|
} else if (isObject(val)) {
|
84
|
-
|
85
|
-
|
212
|
+
if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
|
213
|
+
lastChild = this.element(val);
|
214
|
+
} else {
|
215
|
+
lastChild = this.element(key);
|
216
|
+
lastChild.element(val);
|
217
|
+
}
|
86
218
|
} else {
|
87
219
|
lastChild = this.element(key, val);
|
88
220
|
}
|
89
221
|
}
|
222
|
+
} else if (!this.options.keepNullNodes && text === null) {
|
223
|
+
lastChild = this.dummy();
|
90
224
|
} else {
|
91
225
|
if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
|
92
226
|
lastChild = this.text(text);
|
@@ -103,27 +237,42 @@
|
|
103
237
|
}
|
104
238
|
}
|
105
239
|
if (lastChild == null) {
|
106
|
-
throw new Error("Could not create any elements with: " + name);
|
240
|
+
throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
|
107
241
|
}
|
108
242
|
return lastChild;
|
109
243
|
};
|
110
244
|
|
111
245
|
XMLNode.prototype.insertBefore = function(name, attributes, text) {
|
112
|
-
var child, i, removed;
|
113
|
-
if (
|
114
|
-
|
246
|
+
var child, i, newChild, refChild, removed;
|
247
|
+
if (name != null ? name.type : void 0) {
|
248
|
+
newChild = name;
|
249
|
+
refChild = attributes;
|
250
|
+
newChild.setParent(this);
|
251
|
+
if (refChild) {
|
252
|
+
i = children.indexOf(refChild);
|
253
|
+
removed = children.splice(i);
|
254
|
+
children.push(newChild);
|
255
|
+
Array.prototype.push.apply(children, removed);
|
256
|
+
} else {
|
257
|
+
children.push(newChild);
|
258
|
+
}
|
259
|
+
return newChild;
|
260
|
+
} else {
|
261
|
+
if (this.isRoot) {
|
262
|
+
throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
|
263
|
+
}
|
264
|
+
i = this.parent.children.indexOf(this);
|
265
|
+
removed = this.parent.children.splice(i);
|
266
|
+
child = this.parent.element(name, attributes, text);
|
267
|
+
Array.prototype.push.apply(this.parent.children, removed);
|
268
|
+
return child;
|
115
269
|
}
|
116
|
-
i = this.parent.children.indexOf(this);
|
117
|
-
removed = this.parent.children.splice(i);
|
118
|
-
child = this.parent.element(name, attributes, text);
|
119
|
-
Array.prototype.push.apply(this.parent.children, removed);
|
120
|
-
return child;
|
121
270
|
};
|
122
271
|
|
123
272
|
XMLNode.prototype.insertAfter = function(name, attributes, text) {
|
124
273
|
var child, i, removed;
|
125
274
|
if (this.isRoot) {
|
126
|
-
throw new Error("Cannot insert elements at root level");
|
275
|
+
throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
|
127
276
|
}
|
128
277
|
i = this.parent.children.indexOf(this);
|
129
278
|
removed = this.parent.children.splice(i + 1);
|
@@ -133,24 +282,24 @@
|
|
133
282
|
};
|
134
283
|
|
135
284
|
XMLNode.prototype.remove = function() {
|
136
|
-
var i,
|
285
|
+
var i, ref2;
|
137
286
|
if (this.isRoot) {
|
138
|
-
throw new Error("Cannot remove the root element");
|
287
|
+
throw new Error("Cannot remove the root element. " + this.debugInfo());
|
139
288
|
}
|
140
289
|
i = this.parent.children.indexOf(this);
|
141
|
-
[].splice.apply(this.parent.children, [i, i - i + 1].concat(
|
290
|
+
[].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
|
142
291
|
return this.parent;
|
143
292
|
};
|
144
293
|
|
145
294
|
XMLNode.prototype.node = function(name, attributes, text) {
|
146
|
-
var child,
|
295
|
+
var child, ref2;
|
147
296
|
if (name != null) {
|
148
|
-
name = name
|
297
|
+
name = getValue(name);
|
149
298
|
}
|
150
299
|
attributes || (attributes = {});
|
151
|
-
attributes = attributes
|
300
|
+
attributes = getValue(attributes);
|
152
301
|
if (!isObject(attributes)) {
|
153
|
-
|
302
|
+
ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
|
154
303
|
}
|
155
304
|
child = new XMLElement(this, name, attributes);
|
156
305
|
if (text != null) {
|
@@ -162,6 +311,9 @@
|
|
162
311
|
|
163
312
|
XMLNode.prototype.text = function(value) {
|
164
313
|
var child;
|
314
|
+
if (isObject(value)) {
|
315
|
+
this.element(value);
|
316
|
+
}
|
165
317
|
child = new XMLText(this, value);
|
166
318
|
this.children.push(child);
|
167
319
|
return this;
|
@@ -206,13 +358,19 @@
|
|
206
358
|
return this;
|
207
359
|
};
|
208
360
|
|
361
|
+
XMLNode.prototype.dummy = function() {
|
362
|
+
var child;
|
363
|
+
child = new XMLDummy(this);
|
364
|
+
return child;
|
365
|
+
};
|
366
|
+
|
209
367
|
XMLNode.prototype.instruction = function(target, value) {
|
210
368
|
var insTarget, insValue, instruction, j, len;
|
211
369
|
if (target != null) {
|
212
|
-
target = target
|
370
|
+
target = getValue(target);
|
213
371
|
}
|
214
372
|
if (value != null) {
|
215
|
-
value = value
|
373
|
+
value = getValue(value);
|
216
374
|
}
|
217
375
|
if (Array.isArray(target)) {
|
218
376
|
for (j = 0, len = target.length; j < len; j++) {
|
@@ -257,7 +415,9 @@
|
|
257
415
|
var doc, xmldec;
|
258
416
|
doc = this.document();
|
259
417
|
xmldec = new XMLDeclaration(doc, version, encoding, standalone);
|
260
|
-
if (doc.children
|
418
|
+
if (doc.children.length === 0) {
|
419
|
+
doc.children.unshift(xmldec);
|
420
|
+
} else if (doc.children[0].type === NodeType.Declaration) {
|
261
421
|
doc.children[0] = xmldec;
|
262
422
|
} else {
|
263
423
|
doc.children.unshift(xmldec);
|
@@ -265,21 +425,21 @@
|
|
265
425
|
return doc.root() || doc;
|
266
426
|
};
|
267
427
|
|
268
|
-
XMLNode.prototype.
|
269
|
-
var child, doc, doctype, i, j, k, len, len1,
|
428
|
+
XMLNode.prototype.dtd = function(pubID, sysID) {
|
429
|
+
var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
|
270
430
|
doc = this.document();
|
271
431
|
doctype = new XMLDocType(doc, pubID, sysID);
|
272
|
-
|
273
|
-
for (i = j = 0, len =
|
274
|
-
child =
|
275
|
-
if (child
|
432
|
+
ref2 = doc.children;
|
433
|
+
for (i = j = 0, len = ref2.length; j < len; i = ++j) {
|
434
|
+
child = ref2[i];
|
435
|
+
if (child.type === NodeType.DocType) {
|
276
436
|
doc.children[i] = doctype;
|
277
437
|
return doctype;
|
278
438
|
}
|
279
439
|
}
|
280
|
-
|
281
|
-
for (i = k = 0, len1 =
|
282
|
-
child =
|
440
|
+
ref3 = doc.children;
|
441
|
+
for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
|
442
|
+
child = ref3[i];
|
283
443
|
if (child.isRoot) {
|
284
444
|
doc.children.splice(i, 0, doctype);
|
285
445
|
return doctype;
|
@@ -300,7 +460,7 @@
|
|
300
460
|
var node;
|
301
461
|
node = this;
|
302
462
|
while (node) {
|
303
|
-
if (node.
|
463
|
+
if (node.type === NodeType.Document) {
|
304
464
|
return node.rootObject;
|
305
465
|
} else if (node.isRoot) {
|
306
466
|
return node;
|
@@ -314,7 +474,7 @@
|
|
314
474
|
var node;
|
315
475
|
node = this;
|
316
476
|
while (node) {
|
317
|
-
if (node.
|
477
|
+
if (node.type === NodeType.Document) {
|
318
478
|
return node;
|
319
479
|
} else {
|
320
480
|
node = node.parent;
|
@@ -330,7 +490,7 @@
|
|
330
490
|
var i;
|
331
491
|
i = this.parent.children.indexOf(this);
|
332
492
|
if (i < 1) {
|
333
|
-
throw new Error("Already at the first node");
|
493
|
+
throw new Error("Already at the first node. " + this.debugInfo());
|
334
494
|
}
|
335
495
|
return this.parent.children[i - 1];
|
336
496
|
};
|
@@ -339,7 +499,7 @@
|
|
339
499
|
var i;
|
340
500
|
i = this.parent.children.indexOf(this);
|
341
501
|
if (i === -1 || i === this.parent.children.length - 1) {
|
342
|
-
throw new Error("Already at the last node");
|
502
|
+
throw new Error("Already at the last node. " + this.debugInfo());
|
343
503
|
}
|
344
504
|
return this.parent.children[i + 1];
|
345
505
|
};
|
@@ -353,6 +513,20 @@
|
|
353
513
|
return this;
|
354
514
|
};
|
355
515
|
|
516
|
+
XMLNode.prototype.debugInfo = function(name) {
|
517
|
+
var ref2, ref3;
|
518
|
+
name = name || this.name;
|
519
|
+
if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
|
520
|
+
return "";
|
521
|
+
} else if (name == null) {
|
522
|
+
return "parent: <" + this.parent.name + ">";
|
523
|
+
} else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
|
524
|
+
return "node: <" + name + ">";
|
525
|
+
} else {
|
526
|
+
return "node: <" + name + ">, parent: <" + this.parent.name + ">";
|
527
|
+
}
|
528
|
+
};
|
529
|
+
|
356
530
|
XMLNode.prototype.ele = function(name, attributes, text) {
|
357
531
|
return this.element(name, attributes, text);
|
358
532
|
};
|
@@ -385,10 +559,6 @@
|
|
385
559
|
return this.declaration(version, encoding, standalone);
|
386
560
|
};
|
387
561
|
|
388
|
-
XMLNode.prototype.dtd = function(pubID, sysID) {
|
389
|
-
return this.doctype(pubID, sysID);
|
390
|
-
};
|
391
|
-
|
392
562
|
XMLNode.prototype.e = function(name, attributes, text) {
|
393
563
|
return this.element(name, attributes, text);
|
394
564
|
};
|
@@ -425,6 +595,189 @@
|
|
425
595
|
return this.importDocument(doc);
|
426
596
|
};
|
427
597
|
|
598
|
+
XMLNode.prototype.replaceChild = function(newChild, oldChild) {
|
599
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
600
|
+
};
|
601
|
+
|
602
|
+
XMLNode.prototype.removeChild = function(oldChild) {
|
603
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
604
|
+
};
|
605
|
+
|
606
|
+
XMLNode.prototype.appendChild = function(newChild) {
|
607
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
608
|
+
};
|
609
|
+
|
610
|
+
XMLNode.prototype.hasChildNodes = function() {
|
611
|
+
return this.children.length !== 0;
|
612
|
+
};
|
613
|
+
|
614
|
+
XMLNode.prototype.cloneNode = function(deep) {
|
615
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
616
|
+
};
|
617
|
+
|
618
|
+
XMLNode.prototype.normalize = function() {
|
619
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
620
|
+
};
|
621
|
+
|
622
|
+
XMLNode.prototype.isSupported = function(feature, version) {
|
623
|
+
return true;
|
624
|
+
};
|
625
|
+
|
626
|
+
XMLNode.prototype.hasAttributes = function() {
|
627
|
+
return this.attribs.length !== 0;
|
628
|
+
};
|
629
|
+
|
630
|
+
XMLNode.prototype.compareDocumentPosition = function(other) {
|
631
|
+
var ref, res;
|
632
|
+
ref = this;
|
633
|
+
if (ref === other) {
|
634
|
+
return 0;
|
635
|
+
} else if (this.document() !== other.document()) {
|
636
|
+
res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
|
637
|
+
if (Math.random() < 0.5) {
|
638
|
+
res |= DocumentPosition.Preceding;
|
639
|
+
} else {
|
640
|
+
res |= DocumentPosition.Following;
|
641
|
+
}
|
642
|
+
return res;
|
643
|
+
} else if (ref.isAncestor(other)) {
|
644
|
+
return DocumentPosition.Contains | DocumentPosition.Preceding;
|
645
|
+
} else if (ref.isDescendant(other)) {
|
646
|
+
return DocumentPosition.Contains | DocumentPosition.Following;
|
647
|
+
} else if (ref.isPreceding(other)) {
|
648
|
+
return DocumentPosition.Preceding;
|
649
|
+
} else {
|
650
|
+
return DocumentPosition.Following;
|
651
|
+
}
|
652
|
+
};
|
653
|
+
|
654
|
+
XMLNode.prototype.isSameNode = function(other) {
|
655
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
656
|
+
};
|
657
|
+
|
658
|
+
XMLNode.prototype.lookupPrefix = function(namespaceURI) {
|
659
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
660
|
+
};
|
661
|
+
|
662
|
+
XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {
|
663
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
664
|
+
};
|
665
|
+
|
666
|
+
XMLNode.prototype.lookupNamespaceURI = function(prefix) {
|
667
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
668
|
+
};
|
669
|
+
|
670
|
+
XMLNode.prototype.isEqualNode = function(node) {
|
671
|
+
var i, j, ref2;
|
672
|
+
if (node.nodeType !== this.nodeType) {
|
673
|
+
return false;
|
674
|
+
}
|
675
|
+
if (node.children.length !== this.children.length) {
|
676
|
+
return false;
|
677
|
+
}
|
678
|
+
for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
|
679
|
+
if (!this.children[i].isEqualNode(node.children[i])) {
|
680
|
+
return false;
|
681
|
+
}
|
682
|
+
}
|
683
|
+
return true;
|
684
|
+
};
|
685
|
+
|
686
|
+
XMLNode.prototype.getFeature = function(feature, version) {
|
687
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
688
|
+
};
|
689
|
+
|
690
|
+
XMLNode.prototype.setUserData = function(key, data, handler) {
|
691
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
692
|
+
};
|
693
|
+
|
694
|
+
XMLNode.prototype.getUserData = function(key) {
|
695
|
+
throw new Error("This DOM method is not implemented." + this.debugInfo());
|
696
|
+
};
|
697
|
+
|
698
|
+
XMLNode.prototype.contains = function(other) {
|
699
|
+
if (!other) {
|
700
|
+
return false;
|
701
|
+
}
|
702
|
+
return other === this || this.isDescendant(other);
|
703
|
+
};
|
704
|
+
|
705
|
+
XMLNode.prototype.isDescendant = function(node) {
|
706
|
+
var child, isDescendantChild, j, len, ref2;
|
707
|
+
ref2 = this.children;
|
708
|
+
for (j = 0, len = ref2.length; j < len; j++) {
|
709
|
+
child = ref2[j];
|
710
|
+
if (node === child) {
|
711
|
+
return true;
|
712
|
+
}
|
713
|
+
isDescendantChild = child.isDescendant(node);
|
714
|
+
if (isDescendantChild) {
|
715
|
+
return true;
|
716
|
+
}
|
717
|
+
}
|
718
|
+
return false;
|
719
|
+
};
|
720
|
+
|
721
|
+
XMLNode.prototype.isAncestor = function(node) {
|
722
|
+
return node.isDescendant(this);
|
723
|
+
};
|
724
|
+
|
725
|
+
XMLNode.prototype.isPreceding = function(node) {
|
726
|
+
var nodePos, thisPos;
|
727
|
+
nodePos = this.treePosition(node);
|
728
|
+
thisPos = this.treePosition(this);
|
729
|
+
if (nodePos === -1 || thisPos === -1) {
|
730
|
+
return false;
|
731
|
+
} else {
|
732
|
+
return nodePos < thisPos;
|
733
|
+
}
|
734
|
+
};
|
735
|
+
|
736
|
+
XMLNode.prototype.isFollowing = function(node) {
|
737
|
+
var nodePos, thisPos;
|
738
|
+
nodePos = this.treePosition(node);
|
739
|
+
thisPos = this.treePosition(this);
|
740
|
+
if (nodePos === -1 || thisPos === -1) {
|
741
|
+
return false;
|
742
|
+
} else {
|
743
|
+
return nodePos > thisPos;
|
744
|
+
}
|
745
|
+
};
|
746
|
+
|
747
|
+
XMLNode.prototype.treePosition = function(node) {
|
748
|
+
var found, pos;
|
749
|
+
pos = 0;
|
750
|
+
found = false;
|
751
|
+
this.foreachTreeNode(this.document(), function(childNode) {
|
752
|
+
pos++;
|
753
|
+
if (!found && childNode === node) {
|
754
|
+
return found = true;
|
755
|
+
}
|
756
|
+
});
|
757
|
+
if (found) {
|
758
|
+
return pos;
|
759
|
+
} else {
|
760
|
+
return -1;
|
761
|
+
}
|
762
|
+
};
|
763
|
+
|
764
|
+
XMLNode.prototype.foreachTreeNode = function(node, func) {
|
765
|
+
var child, j, len, ref2, res;
|
766
|
+
node || (node = this.document());
|
767
|
+
ref2 = node.children;
|
768
|
+
for (j = 0, len = ref2.length; j < len; j++) {
|
769
|
+
child = ref2[j];
|
770
|
+
if (res = func(child)) {
|
771
|
+
return res;
|
772
|
+
} else {
|
773
|
+
res = this.foreachTreeNode(child, func);
|
774
|
+
if (res) {
|
775
|
+
return res;
|
776
|
+
}
|
777
|
+
}
|
778
|
+
}
|
779
|
+
};
|
780
|
+
|
428
781
|
return XMLNode;
|
429
782
|
|
430
783
|
})();
|
@@ -0,0 +1,48 @@
|
|
1
|
+
// Generated by CoffeeScript 1.12.7
|
2
|
+
(function() {
|
3
|
+
var XMLNodeFilter;
|
4
|
+
|
5
|
+
module.exports = XMLNodeFilter = (function() {
|
6
|
+
function XMLNodeFilter() {}
|
7
|
+
|
8
|
+
XMLNodeFilter.prototype.FilterAccept = 1;
|
9
|
+
|
10
|
+
XMLNodeFilter.prototype.FilterReject = 2;
|
11
|
+
|
12
|
+
XMLNodeFilter.prototype.FilterSkip = 3;
|
13
|
+
|
14
|
+
XMLNodeFilter.prototype.ShowAll = 0xffffffff;
|
15
|
+
|
16
|
+
XMLNodeFilter.prototype.ShowElement = 0x1;
|
17
|
+
|
18
|
+
XMLNodeFilter.prototype.ShowAttribute = 0x2;
|
19
|
+
|
20
|
+
XMLNodeFilter.prototype.ShowText = 0x4;
|
21
|
+
|
22
|
+
XMLNodeFilter.prototype.ShowCDataSection = 0x8;
|
23
|
+
|
24
|
+
XMLNodeFilter.prototype.ShowEntityReference = 0x10;
|
25
|
+
|
26
|
+
XMLNodeFilter.prototype.ShowEntity = 0x20;
|
27
|
+
|
28
|
+
XMLNodeFilter.prototype.ShowProcessingInstruction = 0x40;
|
29
|
+
|
30
|
+
XMLNodeFilter.prototype.ShowComment = 0x80;
|
31
|
+
|
32
|
+
XMLNodeFilter.prototype.ShowDocument = 0x100;
|
33
|
+
|
34
|
+
XMLNodeFilter.prototype.ShowDocumentType = 0x200;
|
35
|
+
|
36
|
+
XMLNodeFilter.prototype.ShowDocumentFragment = 0x400;
|
37
|
+
|
38
|
+
XMLNodeFilter.prototype.ShowNotation = 0x800;
|
39
|
+
|
40
|
+
XMLNodeFilter.prototype.acceptNode = function(node) {
|
41
|
+
throw new Error("This DOM method is not implemented.");
|
42
|
+
};
|
43
|
+
|
44
|
+
return XMLNodeFilter;
|
45
|
+
|
46
|
+
})();
|
47
|
+
|
48
|
+
}).call(this);
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Generated by CoffeeScript 1.12.7
|
2
|
+
(function() {
|
3
|
+
var XMLNodeList;
|
4
|
+
|
5
|
+
module.exports = XMLNodeList = (function() {
|
6
|
+
function XMLNodeList(nodes) {
|
7
|
+
this.nodes = nodes;
|
8
|
+
}
|
9
|
+
|
10
|
+
Object.defineProperty(XMLNodeList.prototype, 'length', {
|
11
|
+
get: function() {
|
12
|
+
return this.nodes.length || 0;
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
XMLNodeList.prototype.clone = function() {
|
17
|
+
return this.nodes = null;
|
18
|
+
};
|
19
|
+
|
20
|
+
XMLNodeList.prototype.item = function(index) {
|
21
|
+
return this.nodes[index] || null;
|
22
|
+
};
|
23
|
+
|
24
|
+
return XMLNodeList;
|
25
|
+
|
26
|
+
})();
|
27
|
+
|
28
|
+
}).call(this);
|