2009年6月15日 星期一

[dom4j]讀xml

由url取得xml
public Document readxml(URL url) throws MalformedURLException,DocumentException {
SAXReader reader = new SAXReader();
Document document = reader.read(url);
return document;
}


由file取得xml
public Document readxml(URL url) throws MalformedURLException,DocumentException {
SAXReader reader = new SAXReader();
Document document = reader.read(url);
return document;
}

沒有留言:

張貼留言