added a nicer subscript navigation of DOM kinda like jquery but without the $ :)

This commit is contained in:
James Strachan
2012-02-24 17:45:43 +00:00
parent 6bee965c51
commit 5841438134
2 changed files with 27 additions and 10 deletions
+5 -2
View File
@@ -11,6 +11,10 @@ class DomBuilderTest() : TestSupport() {
fun testBuildDocument() {
var doc = createDocument()
assert {
doc["grandchild"].isEmpty()
}
doc.addElement("foo") {
id = "id1"
style = "bold"
@@ -27,8 +31,7 @@ class DomBuilderTest() : TestSupport() {
}
println("builder document: ${doc.toXmlString()}")
val grandChild = doc.elementsByTagName("grandChild").first
val grandChild = doc["grandChild"].first
if (grandChild != null) {
println("got element ${grandChild.toXmlString()} with text '${grandChild.text}`")
assertEquals("Hello World!", grandChild.text)