Code example for CharacterData

Methods: getData

0
private String getCharacterDataFromElement(Element e) {
	try { 
		Node child = e.getFirstChild();
		if (child instanceof CharacterData) {
			CharacterData cd = (CharacterData) child;
			return cd.getData();
		} 
	} catch (Exception ex) {
 
	} 
	return ""; 
} // private String getCharacterDataFromElement 
 
protected float getFloat(String value) {
	if (value != null && !value.equals("")) {
		return Float.parseFloat(value);
	} 
	return 0; 
} 
 
}