use of net.sourceforge.sqlexplorer.dataset.XmlDataType in project tdq-studio-se by Talend.
the class XmlPreviewer method getXml.
private Element getXml(Object data) throws ExplorerException {
try {
if (data == null)
return null;
if (data instanceof XmlDataType)
return ((XmlDataType) data).getRootElement();
String text = data.toString();
if (text == null)
return null;
SAXReader reader = new SAXReader();
return reader.read(new StringReader(text)).getRootElement();
} catch (DocumentException e) {
throw new ExplorerException(e);
}
}
Aggregations