/** * XML解析 * @param detailXML * @return 结果的hashMap形式 * @throws FactoryConfigurationError * @throws Exception */ public static HashMap parseXML(String detailXML) throws FactoryConfigurationError, Exception { ACSSysLogger.debug("Enter Func [xmlParser]"); HashMap xmlmap = new HashMap(); DocumentBuilderFactory dbf = null; try { dbf = DocumentBuilderFactory.newInstance(); } catch (FactoryConfigurationError fce) { ACSSysLogger.error("Error occurred while parse detailParams after authentication!"); fce.toString(); } StringBuffer detailParams = new StringBuffer(1024); detailParams.append("
"); detailParams.append("
"); detailParams.append(detailXML); detailParams.append("
"); try { dbf.setValidating(false); DocumentBuilder docBuilder = dbf.newDocumentBuilder(); ByteArrayInputStream inputStream = new ByteArrayInputStream(detailParams.toString().getBytes("GB2312")); Document doc = docBuilder.parse(inputStream); Element element = doc.getDocumentElement(); NodeList children = element.getChildNodes(); for(int i=0;i