mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
28 lines
461 B
Nim
28 lines
461 B
Nim
discard """
|
|
file: "txmltree.nim"
|
|
output: '''true
|
|
true
|
|
true
|
|
true
|
|
true
|
|
'''
|
|
"""
|
|
|
|
import xmltree, strtabs
|
|
|
|
var x = <>a(href="nim.de", newText("www.nim-test.de"))
|
|
|
|
echo($x == "<a href=\"nim.de\">www.nim-test.de</a>")
|
|
|
|
echo(newText("foo").innerText == "foo")
|
|
echo(newEntity("bar").innerText == "bar")
|
|
echo(newComment("baz").innerText == "")
|
|
|
|
let y = newXmlTree("x", [
|
|
newText("foo"),
|
|
newXmlTree("y", [
|
|
newText("bar")
|
|
])
|
|
])
|
|
echo(y.innerText == "foobar")
|