Code example for CharacterData

Methods: getData

0
		if (nl != null && nl.getLength() > 0) {
			Element el = (Element) nl.item(0);
			Node n = el.getFirstChild();
			if (n instanceof CharacterData) {
				CharacterData cd = (CharacterData) n;
				textVal = cd.getData();
			} 
		} 
		return textVal;
	} 
 
	private float getFloatValue(Element ele, String tagName) {
		return Float.parseFloat(getTextValue(ele, tagName));
	} 
 
	public ArrayList<TerrapinType> parseFile(String path) {
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		Document dom = null;
		ArrayList<TerrapinType> gp = new ArrayList<TerrapinType>();
		try { 
			DocumentBuilder db = dbf.newDocumentBuilder();