List of usage examples for javax.xml.transform Source toString
public String toString()
From source file:jlib.xml.XMLUtil.java
public static Document LoadXML(Source file) { try {//from www . j av a 2s.c o m DocumentBuilderFactory dbf = DocumentBuilderFactoryImpl.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); Result res = new DOMResult(doc); TransformerFactory tr = TransformerFactory.newInstance(); Transformer xformer = tr.newTransformer(); xformer.transform(file, res); return doc; } catch (Exception e) { String csError = e.toString(); Log.logImportant(csError); Log.logImportant("ERROR while loading XML " + file.toString()); } return null; }