by gmartres · 10y ago · 0 comments
var node = element.firstChild;
while (node) {
// do something
node = node.nextSibling;
}
Perhaps those interfaces use the Option class? def printNodes(targetNode: dom.Node): Unit = {
var c = targetNode.firstChild
while (c != null) {
if (c.nodeValue != null) {
println(c.nodeValue)
}
c = c.nextSibling
}
}
The return value from firstChild and nextSibling can be null.