3 var XMLDTDElement, 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 = XMLDTDElement = (
function(superClass) {
10 extend(XMLDTDElement, superClass);
12 function XMLDTDElement(parent, name, value) {
13 XMLDTDElement.__super__.constructor.call(
this, parent);
15 throw new Error(
"Missing DTD element name");
20 if (Array.isArray(value)) {
21 value =
'(' + value.join(
',') +
')';
23 this.name = this.stringify.eleName(name);
24 this.value = this.stringify.dtdElementValue(value);
27 XMLDTDElement.prototype.toString =
function(options) {
28 return this.options.writer.set(options).dtdElement(
this);