typesxml
Version:
Open source XML library written in TypeScript
66 lines • 1.98 kB
JavaScript
"use strict";
/*******************************************************************************
* Copyright (c) 2023 - 2024 Maxprograms.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse License 1.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-v10.html
*
* Contributors:
* Maxprograms - initial API and implementation
*******************************************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityDecl = void 0;
const Constants_1 = require("../Constants");
class EntityDecl {
name;
parameterEntity;
value;
systemId;
publicId;
ndata;
constructor(name, parameterEntity, value, systemId, publicId, ndata) {
// parameterEntities are only used in DTDs
this.name = name;
this.parameterEntity = parameterEntity;
this.value = value;
this.systemId = systemId;
this.publicId = publicId;
this.ndata = ndata;
}
getName() {
return this.name;
}
getValue() {
return this.value;
}
getSystemId() {
return this.systemId;
}
getPublicId() {
return this.publicId;
}
getNodeType() {
return Constants_1.Constants.ENTITY_DECL_NODE;
}
toString() {
let result = '<!ENTITY ' + (this.parameterEntity ? '% ' : '') + this.name;
if (this.publicId !== '' && this.systemId !== '') {
result += ' PUBLIC "' + this.publicId + '" "' + this.systemId + '">';
}
else if (this.systemId !== '') {
result += ' SYSTEM "' + this.systemId + '">';
}
else {
result += ' "' + this.value + '">';
}
return result;
}
equals(node) {
// TODO
return false;
}
}
exports.EntityDecl = EntityDecl;
//# sourceMappingURL=EntityDecl.js.map