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,13 +1,19 @@
1
1
  // Generated by CoffeeScript 1.12.7
2
2
  (function() {
3
- var XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
3
+ var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
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
7
  isPlainObject = require('./Utility').isPlainObject;
8
8
 
9
+ XMLDOMImplementation = require('./XMLDOMImplementation');
10
+
11
+ XMLDOMConfiguration = require('./XMLDOMConfiguration');
12
+
9
13
  XMLNode = require('./XMLNode');
10
14
 
15
+ NodeType = require('./NodeType');
16
+
11
17
  XMLStringifier = require('./XMLStringifier');
12
18
 
13
19
  XMLStringWriter = require('./XMLStringWriter');
@@ -17,28 +23,216 @@
17
23
 
18
24
  function XMLDocument(options) {
19
25
  XMLDocument.__super__.constructor.call(this, null);
26
+ this.name = "#document";
27
+ this.type = NodeType.Document;
28
+ this.documentURI = null;
29
+ this.domConfig = new XMLDOMConfiguration();
20
30
  options || (options = {});
21
31
  if (!options.writer) {
22
32
  options.writer = new XMLStringWriter();
23
33
  }
24
34
  this.options = options;
25
35
  this.stringify = new XMLStringifier(options);
26
- this.isDocument = true;
27
36
  }
28
37
 
38
+ Object.defineProperty(XMLDocument.prototype, 'implementation', {
39
+ value: new XMLDOMImplementation()
40
+ });
41
+
42
+ Object.defineProperty(XMLDocument.prototype, 'doctype', {
43
+ get: function() {
44
+ var child, i, len, ref;
45
+ ref = this.children;
46
+ for (i = 0, len = ref.length; i < len; i++) {
47
+ child = ref[i];
48
+ if (child.type === NodeType.DocType) {
49
+ return child;
50
+ }
51
+ }
52
+ return null;
53
+ }
54
+ });
55
+
56
+ Object.defineProperty(XMLDocument.prototype, 'documentElement', {
57
+ get: function() {
58
+ return this.rootObject || null;
59
+ }
60
+ });
61
+
62
+ Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
63
+ get: function() {
64
+ return null;
65
+ }
66
+ });
67
+
68
+ Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
69
+ get: function() {
70
+ return false;
71
+ }
72
+ });
73
+
74
+ Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
75
+ get: function() {
76
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
77
+ return this.children[0].encoding;
78
+ } else {
79
+ return null;
80
+ }
81
+ }
82
+ });
83
+
84
+ Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
85
+ get: function() {
86
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
87
+ return this.children[0].standalone === 'yes';
88
+ } else {
89
+ return false;
90
+ }
91
+ }
92
+ });
93
+
94
+ Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
95
+ get: function() {
96
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
97
+ return this.children[0].version;
98
+ } else {
99
+ return "1.0";
100
+ }
101
+ }
102
+ });
103
+
104
+ Object.defineProperty(XMLDocument.prototype, 'URL', {
105
+ get: function() {
106
+ return this.documentURI;
107
+ }
108
+ });
109
+
110
+ Object.defineProperty(XMLDocument.prototype, 'origin', {
111
+ get: function() {
112
+ return null;
113
+ }
114
+ });
115
+
116
+ Object.defineProperty(XMLDocument.prototype, 'compatMode', {
117
+ get: function() {
118
+ return null;
119
+ }
120
+ });
121
+
122
+ Object.defineProperty(XMLDocument.prototype, 'characterSet', {
123
+ get: function() {
124
+ return null;
125
+ }
126
+ });
127
+
128
+ Object.defineProperty(XMLDocument.prototype, 'contentType', {
129
+ get: function() {
130
+ return null;
131
+ }
132
+ });
133
+
29
134
  XMLDocument.prototype.end = function(writer) {
30
135
  var writerOptions;
136
+ writerOptions = {};
31
137
  if (!writer) {
32
138
  writer = this.options.writer;
33
139
  } else if (isPlainObject(writer)) {
34
140
  writerOptions = writer;
35
- writer = this.options.writer.set(writerOptions);
141
+ writer = this.options.writer;
36
142
  }
37
- return writer.document(this);
143
+ return writer.document(this, writer.filterOptions(writerOptions));
38
144
  };
39
145
 
40
146
  XMLDocument.prototype.toString = function(options) {
41
- return this.options.writer.set(options).document(this);
147
+ return this.options.writer.document(this, this.options.writer.filterOptions(options));
148
+ };
149
+
150
+ XMLDocument.prototype.createElement = function(tagName) {
151
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
152
+ };
153
+
154
+ XMLDocument.prototype.createDocumentFragment = function() {
155
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
156
+ };
157
+
158
+ XMLDocument.prototype.createTextNode = function(data) {
159
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
160
+ };
161
+
162
+ XMLDocument.prototype.createComment = function(data) {
163
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
164
+ };
165
+
166
+ XMLDocument.prototype.createCDATASection = function(data) {
167
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
168
+ };
169
+
170
+ XMLDocument.prototype.createProcessingInstruction = function(target, data) {
171
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
172
+ };
173
+
174
+ XMLDocument.prototype.createAttribute = function(name) {
175
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
176
+ };
177
+
178
+ XMLDocument.prototype.createEntityReference = function(name) {
179
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
180
+ };
181
+
182
+ XMLDocument.prototype.getElementsByTagName = function(tagname) {
183
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
184
+ };
185
+
186
+ XMLDocument.prototype.importNode = function(importedNode, deep) {
187
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
188
+ };
189
+
190
+ XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) {
191
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
192
+ };
193
+
194
+ XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
195
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
196
+ };
197
+
198
+ XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
199
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
200
+ };
201
+
202
+ XMLDocument.prototype.getElementById = function(elementId) {
203
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
204
+ };
205
+
206
+ XMLDocument.prototype.adoptNode = function(source) {
207
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
208
+ };
209
+
210
+ XMLDocument.prototype.normalizeDocument = function() {
211
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
212
+ };
213
+
214
+ XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
215
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
216
+ };
217
+
218
+ XMLDocument.prototype.getElementsByClassName = function(classNames) {
219
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
220
+ };
221
+
222
+ XMLDocument.prototype.createEvent = function(eventInterface) {
223
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
224
+ };
225
+
226
+ XMLDocument.prototype.createRange = function() {
227
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
228
+ };
229
+
230
+ XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) {
231
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
232
+ };
233
+
234
+ XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) {
235
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
42
236
  };
43
237
 
44
238
  return XMLDocument;
@@ -1,9 +1,13 @@
1
1
  // Generated by CoffeeScript 1.12.7
2
2
  (function() {
3
- var XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, isFunction, isObject, isPlainObject, ref,
3
+ var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref,
4
4
  hasProp = {}.hasOwnProperty;
5
5
 
6
- ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject;
6
+ ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
7
+
8
+ NodeType = require('./NodeType');
9
+
10
+ XMLDocument = require('./XMLDocument');
7
11
 
8
12
  XMLElement = require('./XMLElement');
9
13
 
@@ -35,18 +39,24 @@
35
39
 
36
40
  XMLStringWriter = require('./XMLStringWriter');
37
41
 
42
+ WriterState = require('./WriterState');
43
+
38
44
  module.exports = XMLDocumentCB = (function() {
39
45
  function XMLDocumentCB(options, onData, onEnd) {
40
46
  var writerOptions;
47
+ this.name = "?xml";
48
+ this.type = NodeType.Document;
41
49
  options || (options = {});
50
+ writerOptions = {};
42
51
  if (!options.writer) {
43
- options.writer = new XMLStringWriter(options);
52
+ options.writer = new XMLStringWriter();
44
53
  } else if (isPlainObject(options.writer)) {
45
54
  writerOptions = options.writer;
46
- options.writer = new XMLStringWriter(writerOptions);
55
+ options.writer = new XMLStringWriter();
47
56
  }
48
57
  this.options = options;
49
58
  this.writer = options.writer;
59
+ this.writerOptions = this.writer.filterOptions(writerOptions);
50
60
  this.stringify = new XMLStringifier(options);
51
61
  this.onDataCallback = onData || function() {};
52
62
  this.onEndCallback = onEnd || function() {};
@@ -58,20 +68,69 @@
58
68
  this.root = null;
59
69
  }
60
70
 
71
+ XMLDocumentCB.prototype.createChildNode = function(node) {
72
+ var att, attName, attributes, child, i, len, ref1, ref2;
73
+ switch (node.type) {
74
+ case NodeType.CData:
75
+ this.cdata(node.value);
76
+ break;
77
+ case NodeType.Comment:
78
+ this.comment(node.value);
79
+ break;
80
+ case NodeType.Element:
81
+ attributes = {};
82
+ ref1 = node.attribs;
83
+ for (attName in ref1) {
84
+ if (!hasProp.call(ref1, attName)) continue;
85
+ att = ref1[attName];
86
+ attributes[attName] = att.value;
87
+ }
88
+ this.node(node.name, attributes);
89
+ break;
90
+ case NodeType.Dummy:
91
+ this.dummy();
92
+ break;
93
+ case NodeType.Raw:
94
+ this.raw(node.value);
95
+ break;
96
+ case NodeType.Text:
97
+ this.text(node.value);
98
+ break;
99
+ case NodeType.ProcessingInstruction:
100
+ this.instruction(node.target, node.value);
101
+ break;
102
+ default:
103
+ throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
104
+ }
105
+ ref2 = node.children;
106
+ for (i = 0, len = ref2.length; i < len; i++) {
107
+ child = ref2[i];
108
+ this.createChildNode(child);
109
+ if (child.type === NodeType.Element) {
110
+ this.up();
111
+ }
112
+ }
113
+ return this;
114
+ };
115
+
116
+ XMLDocumentCB.prototype.dummy = function() {
117
+ return this;
118
+ };
119
+
61
120
  XMLDocumentCB.prototype.node = function(name, attributes, text) {
62
121
  var ref1;
63
122
  if (name == null) {
64
- throw new Error("Missing node name");
123
+ throw new Error("Missing node name.");
65
124
  }
66
125
  if (this.root && this.currentLevel === -1) {
67
- throw new Error("Document can only have one root node");
126
+ throw new Error("Document can only have one root node. " + this.debugInfo(name));
68
127
  }
69
128
  this.openCurrent();
70
- name = name.valueOf();
129
+ name = getValue(name);
71
130
  if (attributes == null) {
72
131
  attributes = {};
73
132
  }
74
- attributes = attributes.valueOf();
133
+ attributes = getValue(attributes);
75
134
  if (!isObject(attributes)) {
76
135
  ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
77
136
  }
@@ -86,20 +145,38 @@
86
145
  };
87
146
 
88
147
  XMLDocumentCB.prototype.element = function(name, attributes, text) {
89
- if (this.currentNode && this.currentNode instanceof XMLDocType) {
90
- return this.dtdElement.apply(this, arguments);
148
+ var child, i, len, oldValidationFlag, ref1, root;
149
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
150
+ this.dtdElement.apply(this, arguments);
91
151
  } else {
92
- return this.node(name, attributes, text);
152
+ if (Array.isArray(name) || isObject(name) || isFunction(name)) {
153
+ oldValidationFlag = this.options.noValidation;
154
+ this.options.noValidation = true;
155
+ root = new XMLDocument(this.options).element('TEMP_ROOT');
156
+ root.element(name);
157
+ this.options.noValidation = oldValidationFlag;
158
+ ref1 = root.children;
159
+ for (i = 0, len = ref1.length; i < len; i++) {
160
+ child = ref1[i];
161
+ this.createChildNode(child);
162
+ if (child.type === NodeType.Element) {
163
+ this.up();
164
+ }
165
+ }
166
+ } else {
167
+ this.node(name, attributes, text);
168
+ }
93
169
  }
170
+ return this;
94
171
  };
95
172
 
96
173
  XMLDocumentCB.prototype.attribute = function(name, value) {
97
174
  var attName, attValue;
98
175
  if (!this.currentNode || this.currentNode.children) {
99
- throw new Error("att() can only be used immediately after an ele() call in callback mode");
176
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
100
177
  }
101
178
  if (name != null) {
102
- name = name.valueOf();
179
+ name = getValue(name);
103
180
  }
104
181
  if (isObject(name)) {
105
182
  for (attName in name) {
@@ -111,8 +188,10 @@
111
188
  if (isFunction(value)) {
112
189
  value = value.apply();
113
190
  }
114
- if (!this.options.skipNullAttributes || (value != null)) {
115
- this.currentNode.attributes[name] = new XMLAttribute(this, name, value);
191
+ if (this.options.keepNullAttributes && (value == null)) {
192
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
193
+ } else if (value != null) {
194
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
116
195
  }
117
196
  }
118
197
  return this;
@@ -122,7 +201,7 @@
122
201
  var node;
123
202
  this.openCurrent();
124
203
  node = new XMLText(this, value);
125
- this.onData(this.writer.text(node, this.currentLevel + 1));
204
+ this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
126
205
  return this;
127
206
  };
128
207
 
@@ -130,7 +209,7 @@
130
209
  var node;
131
210
  this.openCurrent();
132
211
  node = new XMLCData(this, value);
133
- this.onData(this.writer.cdata(node, this.currentLevel + 1));
212
+ this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
134
213
  return this;
135
214
  };
136
215
 
@@ -138,7 +217,7 @@
138
217
  var node;
139
218
  this.openCurrent();
140
219
  node = new XMLComment(this, value);
141
- this.onData(this.writer.comment(node, this.currentLevel + 1));
220
+ this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
142
221
  return this;
143
222
  };
144
223
 
@@ -146,7 +225,7 @@
146
225
  var node;
147
226
  this.openCurrent();
148
227
  node = new XMLRaw(this, value);
149
- this.onData(this.writer.raw(node, this.currentLevel + 1));
228
+ this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
150
229
  return this;
151
230
  };
152
231
 
@@ -154,10 +233,10 @@
154
233
  var i, insTarget, insValue, len, node;
155
234
  this.openCurrent();
156
235
  if (target != null) {
157
- target = target.valueOf();
236
+ target = getValue(target);
158
237
  }
159
238
  if (value != null) {
160
- value = value.valueOf();
239
+ value = getValue(value);
161
240
  }
162
241
  if (Array.isArray(target)) {
163
242
  for (i = 0, len = target.length; i < len; i++) {
@@ -175,7 +254,7 @@
175
254
  value = value.apply();
176
255
  }
177
256
  node = new XMLProcessingInstruction(this, target, value);
178
- this.onData(this.writer.processingInstruction(node, this.currentLevel + 1));
257
+ this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
179
258
  }
180
259
  return this;
181
260
  };
@@ -184,20 +263,20 @@
184
263
  var node;
185
264
  this.openCurrent();
186
265
  if (this.documentStarted) {
187
- throw new Error("declaration() must be the first node");
266
+ throw new Error("declaration() must be the first node.");
188
267
  }
189
268
  node = new XMLDeclaration(this, version, encoding, standalone);
190
- this.onData(this.writer.declaration(node, this.currentLevel + 1));
269
+ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
191
270
  return this;
192
271
  };
193
272
 
194
273
  XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
195
274
  this.openCurrent();
196
275
  if (root == null) {
197
- throw new Error("Missing root node name");
276
+ throw new Error("Missing root node name.");
198
277
  }
199
278
  if (this.root) {
200
- throw new Error("dtd() must come before the root node");
279
+ throw new Error("dtd() must come before the root node.");
201
280
  }
202
281
  this.currentNode = new XMLDocType(this, pubID, sysID);
203
282
  this.currentNode.rootNodeName = root;
@@ -211,7 +290,7 @@
211
290
  var node;
212
291
  this.openCurrent();
213
292
  node = new XMLDTDElement(this, name, value);
214
- this.onData(this.writer.dtdElement(node, this.currentLevel + 1));
293
+ this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
215
294
  return this;
216
295
  };
217
296
 
@@ -219,7 +298,7 @@
219
298
  var node;
220
299
  this.openCurrent();
221
300
  node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
222
- this.onData(this.writer.dtdAttList(node, this.currentLevel + 1));
301
+ this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
223
302
  return this;
224
303
  };
225
304
 
@@ -227,7 +306,7 @@
227
306
  var node;
228
307
  this.openCurrent();
229
308
  node = new XMLDTDEntity(this, false, name, value);
230
- this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
309
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
231
310
  return this;
232
311
  };
233
312
 
@@ -235,7 +314,7 @@
235
314
  var node;
236
315
  this.openCurrent();
237
316
  node = new XMLDTDEntity(this, true, name, value);
238
- this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
317
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
239
318
  return this;
240
319
  };
241
320
 
@@ -243,13 +322,13 @@
243
322
  var node;
244
323
  this.openCurrent();
245
324
  node = new XMLDTDNotation(this, name, value);
246
- this.onData(this.writer.dtdNotation(node, this.currentLevel + 1));
325
+ this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
247
326
  return this;
248
327
  };
249
328
 
250
329
  XMLDocumentCB.prototype.up = function() {
251
330
  if (this.currentLevel < 0) {
252
- throw new Error("The document node has no parent");
331
+ throw new Error("The document node has no parent.");
253
332
  }
254
333
  if (this.currentNode) {
255
334
  if (this.currentNode.children) {
@@ -281,25 +360,64 @@
281
360
  };
282
361
 
283
362
  XMLDocumentCB.prototype.openNode = function(node) {
363
+ var att, chunk, name, ref1;
284
364
  if (!node.isOpen) {
285
- if (!this.root && this.currentLevel === 0 && node instanceof XMLElement) {
365
+ if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
286
366
  this.root = node;
287
367
  }
288
- this.onData(this.writer.openNode(node, this.currentLevel));
368
+ chunk = '';
369
+ if (node.type === NodeType.Element) {
370
+ this.writerOptions.state = WriterState.OpenTag;
371
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
372
+ ref1 = node.attribs;
373
+ for (name in ref1) {
374
+ if (!hasProp.call(ref1, name)) continue;
375
+ att = ref1[name];
376
+ chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
377
+ }
378
+ chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
379
+ this.writerOptions.state = WriterState.InsideTag;
380
+ } else {
381
+ this.writerOptions.state = WriterState.OpenTag;
382
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
383
+ if (node.pubID && node.sysID) {
384
+ chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
385
+ } else if (node.sysID) {
386
+ chunk += ' SYSTEM "' + node.sysID + '"';
387
+ }
388
+ if (node.children) {
389
+ chunk += ' [';
390
+ this.writerOptions.state = WriterState.InsideTag;
391
+ } else {
392
+ this.writerOptions.state = WriterState.CloseTag;
393
+ chunk += '>';
394
+ }
395
+ chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
396
+ }
397
+ this.onData(chunk, this.currentLevel);
289
398
  return node.isOpen = true;
290
399
  }
291
400
  };
292
401
 
293
402
  XMLDocumentCB.prototype.closeNode = function(node) {
403
+ var chunk;
294
404
  if (!node.isClosed) {
295
- this.onData(this.writer.closeNode(node, this.currentLevel));
405
+ chunk = '';
406
+ this.writerOptions.state = WriterState.CloseTag;
407
+ if (node.type === NodeType.Element) {
408
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
409
+ } else {
410
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
411
+ }
412
+ this.writerOptions.state = WriterState.None;
413
+ this.onData(chunk, this.currentLevel);
296
414
  return node.isClosed = true;
297
415
  }
298
416
  };
299
417
 
300
- XMLDocumentCB.prototype.onData = function(chunk) {
418
+ XMLDocumentCB.prototype.onData = function(chunk, level) {
301
419
  this.documentStarted = true;
302
- return this.onDataCallback(chunk);
420
+ return this.onDataCallback(chunk, level + 1);
303
421
  };
304
422
 
305
423
  XMLDocumentCB.prototype.onEnd = function() {
@@ -307,6 +425,14 @@
307
425
  return this.onEndCallback();
308
426
  };
309
427
 
428
+ XMLDocumentCB.prototype.debugInfo = function(name) {
429
+ if (name == null) {
430
+ return "";
431
+ } else {
432
+ return "node: <" + name + ">";
433
+ }
434
+ };
435
+
310
436
  XMLDocumentCB.prototype.ele = function() {
311
437
  return this.element.apply(this, arguments);
312
438
  };
@@ -368,7 +494,7 @@
368
494
  };
369
495
 
370
496
  XMLDocumentCB.prototype.att = function() {
371
- if (this.currentNode && this.currentNode instanceof XMLDocType) {
497
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
372
498
  return this.attList.apply(this, arguments);
373
499
  } else {
374
500
  return this.attribute.apply(this, arguments);
@@ -376,7 +502,7 @@
376
502
  };
377
503
 
378
504
  XMLDocumentCB.prototype.a = function() {
379
- if (this.currentNode && this.currentNode instanceof XMLDocType) {
505
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
380
506
  return this.attList.apply(this, arguments);
381
507
  } else {
382
508
  return this.attribute.apply(this, arguments);
@@ -0,0 +1,24 @@
1
+ // Generated by CoffeeScript 1.12.7
2
+ (function() {
3
+ var NodeType, XMLDocumentFragment, XMLNode,
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
+ hasProp = {}.hasOwnProperty;
6
+
7
+ XMLNode = require('./XMLNode');
8
+
9
+ NodeType = require('./NodeType');
10
+
11
+ module.exports = XMLDocumentFragment = (function(superClass) {
12
+ extend(XMLDocumentFragment, superClass);
13
+
14
+ function XMLDocumentFragment() {
15
+ XMLDocumentFragment.__super__.constructor.call(this, null);
16
+ this.name = "#document-fragment";
17
+ this.type = NodeType.DocumentFragment;
18
+ }
19
+
20
+ return XMLDocumentFragment;
21
+
22
+ })(XMLNode);
23
+
24
+ }).call(this);