summary refs log tree commit diff stats
path: root/lib/pure/xmltree.nim
diff options
context:
space:
mode:
authorAndrey Sobolev <andrey.sobolev@xored.com>2015-09-07 12:25:53 +0600
committerAndrey Sobolev <andrey.sobolev@xored.com>2015-09-07 12:25:53 +0600
commitf405876b35b4ff4f95dcd289bd51df196aab5569 (patch)
tree83dd794bc2d4692784c46517cc708bc8fb5426ad /lib/pure/xmltree.nim
parenteb4263a0fc4792ebff4f051f8a5a33d7bffbdb48 (diff)
downloadNim-f405876b35b4ff4f95dcd289bd51df196aab5569.tar.gz
add text modification proc
Diffstat (limited to 'lib/pure/xmltree.nim')
-rw-r--r--lib/pure/xmltree.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim
index 4269a3e48..435a7a549 100644
--- a/lib/pure/xmltree.nim
+++ b/lib/pure/xmltree.nim
@@ -74,6 +74,12 @@ proc text*(n: XmlNode): string {.inline.} =
   assert n.k in {xnText, xnComment, xnCData, xnEntity}
   result = n.fText
 
+proc `text=`*(n: XmlNode, text: string){.inline.} =
+  ## sets the associated text with the node `n`. `n` can be a CDATA, Text,
+  ## comment, or entity node.
+  assert n.k in {xnText, xnComment, xnCData, xnEntity}
+  n.fText = text
+
 proc rawText*(n: XmlNode): string {.inline.} =
   ## returns the underlying 'text' string by reference.
   ## This is only used for speed hacks.