typesxml
Version:
Open source XML library written in TypeScript
63 lines • 1.98 kB
JavaScript
"use strict";
/*******************************************************************************
* Copyright (c) 2023-2026 Maxprograms.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public 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.NotationDecl = void 0;
const Constants_js_1 = require("../Constants.js");
class NotationDecl {
name;
publicId;
systemId;
constructor(name, publicId, systemId) {
this.name = name;
this.publicId = publicId;
this.systemId = systemId;
}
getName() {
return this.name;
}
getPublicId() {
return this.publicId;
}
getSystemId() {
return this.systemId;
}
getNodeType() {
return Constants_js_1.Constants.NOTATION_DECL_NODE;
}
toString() {
let result = '<!NOTATION ' + this.name;
if (this.publicId && this.publicId.length > 0) {
result += ' PUBLIC "' + this.publicId + '"';
}
if (this.systemId && this.systemId.length > 0) {
if (this.publicId && this.publicId.length > 0) {
result += ' "' + this.systemId + '"';
}
else {
result += ' SYSTEM "' + this.systemId + '"';
}
}
result += '>';
return result;
}
equals(node) {
if (node instanceof NotationDecl) {
return this.name === node.name &&
this.publicId === node.publicId &&
this.systemId === node.systemId;
}
return false;
}
}
exports.NotationDecl = NotationDecl;
//# sourceMappingURL=NotationDecl.js.map