00001
00002 (function() {
00003 var XMLDTDNotation, XMLNode,
00004 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; },
00005 hasProp = {}.hasOwnProperty;
00006
00007 XMLNode = require('./XMLNode');
00008
00009 module.exports = XMLDTDNotation = (function(superClass) {
00010 extend(XMLDTDNotation, superClass);
00011
00012 function XMLDTDNotation(parent, name, value) {
00013 XMLDTDNotation.__super__.constructor.call(this, parent);
00014 if (name == null) {
00015 throw new Error("Missing notation name");
00016 }
00017 if (!value.pubID && !value.sysID) {
00018 throw new Error("Public or system identifiers are required for an external entity");
00019 }
00020 this.name = this.stringify.eleName(name);
00021 if (value.pubID != null) {
00022 this.pubID = this.stringify.dtdPubID(value.pubID);
00023 }
00024 if (value.sysID != null) {
00025 this.sysID = this.stringify.dtdSysID(value.sysID);
00026 }
00027 }
00028
00029 XMLDTDNotation.prototype.toString = function(options) {
00030 return this.options.writer.set(options).dtdNotation(this);
00031 };
00032
00033 return XMLDTDNotation;
00034
00035 })(XMLNode);
00036
00037 }).call(this);