diff options
Diffstat (limited to 'node_modules/xmlbuilder/lib/XMLDTDNotation.js')
-rw-r--r-- | node_modules/xmlbuilder/lib/XMLDTDNotation.js | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/node_modules/xmlbuilder/lib/XMLDTDNotation.js index 8747d9dd8..edd3501fa 100644 --- a/node_modules/xmlbuilder/lib/XMLDTDNotation.js +++ b/node_modules/xmlbuilder/lib/XMLDTDNotation.js @@ -1,16 +1,12 @@ -// Generated by CoffeeScript 1.10.0 +// Generated by CoffeeScript 1.9.1 (function() { - var XMLDTDNotation, XMLNode, - 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; }, - hasProp = {}.hasOwnProperty; + var XMLDTDNotation, create; - XMLNode = require('./XMLNode'); - - module.exports = XMLDTDNotation = (function(superClass) { - extend(XMLDTDNotation, superClass); + create = require('lodash/create'); + module.exports = XMLDTDNotation = (function() { function XMLDTDNotation(parent, name, value) { - XMLDTDNotation.__super__.constructor.call(this, parent); + this.stringify = parent.stringify; if (name == null) { throw new Error("Missing notation name"); } @@ -26,12 +22,35 @@ } } - XMLDTDNotation.prototype.toString = function(options) { - return this.options.writer.set(options).dtdNotation(this); + XMLDTDNotation.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!NOTATION ' + this.name; + if (this.pubID && this.sysID) { + r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; + } else if (this.pubID) { + r += ' PUBLIC "' + this.pubID + '"'; + } else if (this.sysID) { + r += ' SYSTEM "' + this.sysID + '"'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; }; return XMLDTDNotation; - })(XMLNode); + })(); }).call(this); |