3 var XMLDTDElement, create;
5 create = require(
'lodash/create');
7 module.exports = XMLDTDElement = (
function() {
8 function XMLDTDElement(parent, name, value) {
9 this.stringify = parent.stringify;
11 throw new Error(
"Missing DTD element name");
16 if (Array.isArray(value)) {
17 value =
'(' + value.join(
',') +
')';
19 this.name = this.stringify.eleName(name);
20 this.value = this.stringify.dtdElementValue(value);
23 XMLDTDElement.prototype.toString =
function(options, level) {
24 var indent, newline, offset, pretty, r, ref, ref1, ref2, space;
25 pretty = (options != null ? options.pretty :
void 0) ||
false;
26 indent = (ref = options != null ? options.indent :
void 0) != null ? ref :
' ';
27 offset = (ref1 = options != null ? options.offset :
void 0) != null ? ref1 : 0;
28 newline = (ref2 = options != null ? options.newline :
void 0) != null ? ref2 :
'\n';
30 space =
new Array(level + offset + 1).join(indent);
35 r +=
'<!ELEMENT ' + this.name +
' ' + this.value +
'>';