Code example for Element

Methods: getAttributesgetNodeName

0
	public IoSession getSession() { 
		return session;
	} 
 
	public String getTransactionID() {
		if (parsedResponse.getNodeName().equals("init"))
			return "init"; 
		 
		return getAttribute("transaction_id"); 
	} 
 
	public boolean hasAttribute(String attr) {
		return parsedResponse.getAttributes().getNamedItem(attr) != null;
	} 
 
	public String getAttribute(String attr) {
		Node item = parsedResponse.getAttributes().getNamedItem(attr);
		 
		if (item == null)
			return null; //raise error? 
		 
		return item.getNodeValue();