allow to delete xmlnode childs

This commit is contained in:
Andrey Sobolev
2015-09-07 21:19:52 +06:00
parent f405876b35
commit a534434056

View File

@@ -121,6 +121,11 @@ proc `[]`* (n: XmlNode, i: int): XmlNode {.inline.} =
assert n.k == xnElement
result = n.s[i]
proc delete*(n: XmlNode, i: Natural) {.noSideEffect.} =
## delete the `i`'th child of `n`.
assert n.k == xnElement
n.s.delete(i)
proc mget* (n: var XmlNode, i: int): var XmlNode {.inline.} =
## returns the `i`'th child of `n` so that it can be modified
assert n.k == xnElement