diff --git a/core/src/processing/data/XML.java b/core/src/processing/data/XML.java index b345465e3..28023b768 100644 --- a/core/src/processing/data/XML.java +++ b/core/src/processing/data/XML.java @@ -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 diff --git a/core/todo.txt b/core/todo.txt index 82e694752..cf07a64ed 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -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")