/***
* 把一个XML字符串转换为一个XML文档对象
* @param returnXML : XML字符串
* @return Document xml文档对象
* @throws Exception
*/
private org.w3c.dom.Document getDocument(String returnXML) throws BOException
{
org.w3c.dom.Document doc = null;
if (returnXML != null && returnXML.length() > 0)
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = null;
try
{
db = dbf.newDocumentBuilder();
}
catch (ParserConfigurationException pce)
{
pce.printStackTrace();
}
try
{
StringReader rd = new StringReader(returnXML);
InputSource in = new InputSource(rd);
doc = db.parse(in);
} catch (IOException ioe) { ioe.printStackTrace(); } catch (SAXException saxe) { saxe.printStackTrace(); } } return doc; }