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;
7 XMLNode = require(
'./XMLNode');
9 module.exports = XMLDTDNotation = (
function(superClass) {
10 extend(XMLDTDNotation, superClass);
12 function XMLDTDNotation(parent, name, value) {
13 XMLDTDNotation.__super__.constructor.call(
this, parent);
15 throw new Error(
"Missing notation name");
17 if (!value.pubID && !value.sysID) {
18 throw new Error(
"Public or system identifiers are required for an external entity");
20 this.name = this.stringify.eleName(name);
21 if (value.pubID != null) {
22 this.pubID = this.stringify.dtdPubID(value.pubID);
24 if (value.sysID != null) {
25 this.sysID = this.stringify.dtdSysID(value.sysID);
29 XMLDTDNotation.prototype.toString =
function(options) {
30 return this.options.writer.set(options).dtdNotation(
this);
33 return XMLDTDNotation;