So I found the problem which was: the `text*` getter was incomplete.
All node kinds (other than `xnElement`) have an `fText` property. That's why
there was as guard assertion in place which is what was causing the crash as I
was trying to get the text of an `xnElement`.
`xnElement` stores it's
I had considered the same work around. However the purpose of the
[`text`](https://nim-lang.org/docs/xmltree.html#text%2CXmlNode) proc is stated
as: "Gets the associated text with the node `n`"
TBH I would rather spend a week trying to figure out how to fix `xmltree` and
submit a PR than code a
I opted against `innerText` because it does indeed return the text of the node
and all it's children:
import xmltree
var e = newElement("child1")
e.add newText(" jibber")
var f = newElement("child2")
f.add newText(" jabber")
var x = newXmlTree("root
Hi, Mr Nim Newbie here,
when I run the following code fragment
import xmltree
var e = newElement("elem")
e.add newText("some text")
echo typeof e
echo typeof e.text
echo e
echo e.text
Run
It crashes and I get the resulting output