解析格式为纯字符串的MAP封装起来的XML:(1)


  
    TASKTRANSACTOR
    lg629 627294
  
  
	 
	   draftFile
	 
	 
	   TASKID
	   N0000000000101341854
	 
	 
	   ISNEWFLOW
	   1
	 
  
  
    SYSID
    1411037022335
  

用MAP封装起来的XML,格式如下,比如我要取TASKID对应的值,怎么取?而且这个MAP又是字符串的形式传来的:

--------解析格式为纯字符串的MAP封装起来的XML:
package com.paic.incentive.core.common.eoa.biz.service.impl;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.paic.incentive.core.common.eoa.biz.service.IEoaService;
import com.paic.incentive.core.reward.award.personnel.integration.dao.SpecialGrantDAO;
import com.paic.incentive.core.util.SpringUtil;


/**
 * @author EX-YEZHIQIANG001
 * xifre方式调用 实现类(解析格式为纯字符串的MAP封装起来的XML)
 */


public class EoaServiceImpl implements IEoaService {


private SpecialGrantDAO specialGrantDAO;

@SuppressWarnings("unchecked")
@Override
public void recevieEoaMsg(String taskInfo) {
try {
byte[] b = taskInfo.getBytes("UTF-8");
ByteArrayInputStream is = new ByteArrayInputStream(b);

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(is);
String taskId = "";
String taskstatus = "";
Element e = doc.getDocumentElement();

//解析XML
NodeList nodeList = e.getElementsByTagName("entry");
Element element = null;
for(int i=0;i


你可能感兴趣的:(解析格式为纯字符串的MAP封装起来的XML:(1))