(parent, pe, name, value)
| 30378 | extend(XMLDTDEntity, superClass); |
| 30379 | |
| 30380 | function XMLDTDEntity(parent, pe, name, value) { |
| 30381 | XMLDTDEntity.__super__.constructor.call(this, parent); |
| 30382 | if (name == null) { |
| 30383 | throw new Error("Missing DTD entity name. " + this.debugInfo(name)); |
| 30384 | } |
| 30385 | if (value == null) { |
| 30386 | throw new Error("Missing DTD entity value. " + this.debugInfo(name)); |
| 30387 | } |
| 30388 | this.pe = !!pe; |
| 30389 | this.name = this.stringify.eleName(name); |
| 30390 | if (!isObject(value)) { |
| 30391 | this.value = this.stringify.dtdEntityValue(value); |
| 30392 | } else { |
| 30393 | if (!value.pubID && !value.sysID) { |
| 30394 | throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name)); |
| 30395 | } |
| 30396 | if (value.pubID && !value.sysID) { |
| 30397 | throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name)); |
| 30398 | } |
| 30399 | if (value.pubID != null) { |
| 30400 | this.pubID = this.stringify.dtdPubID(value.pubID); |
| 30401 | } |
| 30402 | if (value.sysID != null) { |
| 30403 | this.sysID = this.stringify.dtdSysID(value.sysID); |
| 30404 | } |
| 30405 | if (value.nData != null) { |
| 30406 | this.nData = this.stringify.dtdNData(value.nData); |
| 30407 | } |
| 30408 | if (this.pe && this.nData) { |
| 30409 | throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name)); |
| 30410 | } |
| 30411 | } |
| 30412 | } |
| 30413 | |
| 30414 | XMLDTDEntity.prototype.toString = function(options) { |
| 30415 | return this.options.writer.set(options).dtdEntity(this); |
nothing calls this directly
no test coverage detected