Skip to content

Commit 99daa5e

Browse files
committed
add getContent(defaultValue) to XML
1 parent f3788fb commit 99daa5e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/src/processing/data/XML.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,12 @@ public String getContent() {
810810
}
811811

812812

813+
public String getContent(String defaultValue) {
814+
String s = node.getTextContent();
815+
return (s != null) ? s : defaultValue;
816+
}
817+
818+
813819
/**
814820
* @webref xml:method
815821
* @brief Gets the content of an element as an int

core/todo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ X when using increment() on IntList, make sure the index exists
2929
X automatically resize the list if necessary
3030
X (this is more in keeping with increment() in the Dict classes)
3131
X add join() method to Int/Float/StringList
32+
X add getContent(defaultValue) to XML
3233

3334
cleaning
3435
X load/save methods.. is it save("blah.svg") or saveSVG("blah.svg")

0 commit comments

Comments
 (0)