From 7db89b166ac479ec46e5977e16aa13f0ef404422 Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@fastmail.com>
Date: Wed, 24 Jul 2019 03:16:48 +0200
Subject: [PATCH] Added set_text() to update the contents of a text node.

---
 lib/modules/Parser.pmod/XML.pmod/Tree.pmod | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/modules/Parser.pmod/XML.pmod/Tree.pmod b/lib/modules/Parser.pmod/XML.pmod/Tree.pmod
index 8d7ebafaf6..d6da524717 100644
--- a/lib/modules/Parser.pmod/XML.pmod/Tree.pmod
+++ b/lib/modules/Parser.pmod/XML.pmod/Tree.pmod
@@ -881,6 +881,12 @@ protected class VirtualNode {
   //! Returns text content in node.
   string get_text()          { return (mText); }
 
+  //! Change the text content descructively.
+  string set_text(string txt) {
+    if( mNodeType & XML_TEXT )
+      mText = txt;
+  }
+
   //!
   int get_doc_order()        { return (mDocOrder); }
 
-- 
GitLab