typesxml
Version:
Open source XML library written in TypeScript
38 lines • 1.11 kB
JavaScript
/*******************************************************************************
* Copyright (c) 2023-2026 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
*******************************************************************************/
import { Constants } from "./Constants.js";
import { XMLUtils } from "./XMLUtils.js";
export class TextNode {
value;
constructor(value) {
this.value = value;
}
setValue(value) {
this.value = value;
}
getValue() {
return this.value;
}
getNodeType() {
return Constants.TEXT_NODE;
}
toString() {
return XMLUtils.cleanString(this.value);
}
equals(node) {
if (node instanceof TextNode) {
return this.value === node.value;
}
return false;
}
}
//# sourceMappingURL=TextNode.js.map