xml节点属性值

		Map<String, Object> map = new HashMap<String, Object>();
		Object xmlObject = list.get(0).get("processdefcontent");
		try {
			Document document = DocumentHelper.parseText(xmlObject + "");
			List<Node> activityList = document.selectNodes("//Activity");			
			if(activityList != null){
				for(Node node : activityList){
					Element activity = (Element) node;
					Attribute idAttribute = activity.attribute("id");
					Attribute repoAttribute = activity.attribute("repo_id");
					map.put(idAttribute.getValue(), repoAttribute.getValue());
				}
			}
		} catch (DocumentException e1) {
			return null;
		}

你可能感兴趣的:(xml节点属性值)