/ cloudformation-templates / node_modules / aws-cdk / node_modules / xmlbuilder / lib / XMLDTDNotation.js
XMLDTDNotation.js
1 // Generated by CoffeeScript 1.12.7 2 (function() { 3 var XMLDTDNotation, 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 module.exports = XMLDTDNotation = (function(superClass) { 10 extend(XMLDTDNotation, superClass); 11 12 function XMLDTDNotation(parent, name, value) { 13 XMLDTDNotation.__super__.constructor.call(this, parent); 14 if (name == null) { 15 throw new Error("Missing notation name"); 16 } 17 if (!value.pubID && !value.sysID) { 18 throw new Error("Public or system identifiers are required for an external entity"); 19 } 20 this.name = this.stringify.eleName(name); 21 if (value.pubID != null) { 22 this.pubID = this.stringify.dtdPubID(value.pubID); 23 } 24 if (value.sysID != null) { 25 this.sysID = this.stringify.dtdSysID(value.sysID); 26 } 27 } 28 29 XMLDTDNotation.prototype.toString = function(options) { 30 return this.options.writer.set(options).dtdNotation(this); 31 }; 32 33 return XMLDTDNotation; 34 35 })(XMLNode); 36 37 }).call(this);