Document document = null;
try {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
// 接收航信电子票返回的信息
document = builder.parse(new ByteArrayInputStream(retStr
.getBytes("utf-8")));
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException("开票失败!!!解析航信返回信息为: " + document);
}
NodeList fphm = document.getElementsByTagName("FP_HM"); // 发票号码
try {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
// 接收航信电子票返回的信息
document = builder.parse(new ByteArrayInputStream(retStr
.getBytes("utf-8")));
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException("开票失败!!!解析航信返回信息为: " + document);
}
NodeList fphm = document.getElementsByTagName("FP_HM"); // 发票号码
NodeList fpdm = document.getElementsByTagName("FP_DM"); // 发票代码
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;