Document 创建与接收

Document reqDoc = null;
// 格式转换
reqDoc = DocumentHelper.parseText(reqMsg);
// 获取单个内容
ele = ((Element) reqDoc.selectSingleNode("//request/member_code"));
String logisticMemberCode = ele != null ? ele.getTextTrim() : "";
// 获取集合
List fundOfSubjectList = reqDoc.selectNodes("//request/settlement/funds");
for (Node n : fundOfSubjectList) {
    ele = (Element) n.selectSingleNode("subject_type");
    subjectType = ele != null ? ele.getTextTrim() : "";
}

你可能感兴趣的:(Document 创建与接收)