add getContent(defaultValue) to XML

This commit is contained in:
Ben Fry
2013-08-12 17:22:06 -04:00
parent 61b34b4f9b
commit 99eef5107b
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -810,6 +810,12 @@ public class XML implements Serializable {
}
public String getContent(String defaultValue) {
String s = node.getTextContent();
return (s != null) ? s : defaultValue;
}
/**
* @webref xml:method
* @brief Gets the content of an element as an int
+1
View File
@@ -29,6 +29,7 @@ X when using increment() on IntList, make sure the index exists
X automatically resize the list if necessary
X (this is more in keeping with increment() in the Dict classes)
X add join() method to Int/Float/StringList
X add getContent(defaultValue) to XML
cleaning
X load/save methods.. is it save("blah.svg") or saveSVG("blah.svg")