Code example for Element

Methods: getElementsByTagName

0
		org.w3c.dom.Element element = doc.getDocumentElement();
		//call the helper function to  convert the xml to switch statement 
		if (element != null) { 
			//NodeList enumUnitNodeList = element.getElementsByTagName("EnumValues"); 
			//System.out.println(" enumlist first value " + enumUnitNodeList.item(0).getFirstChild().getTextContent()); 
			NodeList normalUnitNodeList = element.getElementsByTagName("NormalUnits");
			NodeList equalUnitNodeList = element.getElementsByTagName("EqualUnits");
			NodeList convertingUnitNodeList = element.getElementsByTagName("ConvertingUnits");
			System.out.println(" normal units " + normalUnitNodeList.item(0).getNodeName());
		} 
		 
		UnitConverstionUtil unitConverstionUtil = new UnitConverstionUtil();
		String unitCdSwitch = unitConverstionUtil.buildUnitCdSwitchClause(element,false,""); 
		String unitInClause = unitConverstionUtil.buildUnitCdInClause(element,"");
		System.out.println(" sql :  " + unitCdSwitch + unitInClause);
		 
		//String unitCdSql = this.callUnitCdConversion( element); 
		 
		//assertNotNull(resultList); 
		 
	}