Skip to content
Permalink
Newer
Older
100644 43 lines (34 sloc) 1.48 KB
Ignoring revisions in .git-blame-ignore-revs.
August 3, 2022 13:36
1
// Generated by CoffeeScript 1.12.7
2
(function() {
3
var NodeType, XMLDeclaration, XMLNode, isObject,
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
isObject = require('./Utility').isObject;
8
9
XMLNode = require('./XMLNode');
10
11
NodeType = require('./NodeType');
12
13
module.exports = XMLDeclaration = (function(superClass) {
14
extend(XMLDeclaration, superClass);
15
16
function XMLDeclaration(parent, version, encoding, standalone) {
17
var ref;
18
XMLDeclaration.__super__.constructor.call(this, parent);
19
if (isObject(version)) {
20
ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
21
}
22
if (!version) {
23
version = '1.0';
24
}
25
this.type = NodeType.Declaration;
26
this.version = this.stringify.xmlVersion(version);
27
if (encoding != null) {
28
this.encoding = this.stringify.xmlEncoding(encoding);
29
}
30
if (standalone != null) {
31
this.standalone = this.stringify.xmlStandalone(standalone);
32
}
33
}
34
35
XMLDeclaration.prototype.toString = function(options) {
36
return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
37
};
38
39
return XMLDeclaration;
40
41
})(XMLNode);
42
43
}).call(this);