}
if (unmarshaller.getClass().getName().contains("eclipse")) {
//eclipse MOXy doesn't work properly with the XMLFilter/Reader thing
//so we need to bounce through a DOM
Source reader = new StaxSource(StaxUtils.createXMLStreamReader(is));
DOMResult dom = new DOMResult();
t.newTransformer().transform(reader, dom);
return unmarshaller.unmarshal(dom.getNode());
}
XMLFilter filter = null;
try {
filter = factory.newXMLFilter(t);
} catch (TransformerConfigurationException ex) {
TemplatesImpl ti = (TemplatesImpl)t;
filter = factory.newXMLFilter(ti.getTemplates());
trySettingProperties(filter, ti);
}
XMLReader reader = new StaxSource(StaxUtils.createXMLStreamReader(is));
filter.setParent(reader);
SAXSource source = new SAXSource();
source.setXMLReader(filter);
if (systemId != null) {
source.setSystemId(systemId);