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

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