UNPKG

typesxml

Version:

Open source XML library written in TypeScript

59 lines 1.82 kB
/******************************************************************************* * 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 *******************************************************************************/ import { Constants } from "../Constants.js"; export 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.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; } } //# sourceMappingURL=NotationDecl.js.map