if (ss.getXMLReader() == null) {
return createXMLStreamReader(((SAXSource)source).getInputSource());
}
}
XMLInputFactory factory = getXMLInputFactory();
try {
XMLStreamReader reader = null;
try {
reader = factory.createXMLStreamReader(source);
} catch (UnsupportedOperationException e) {
//ignore
}
if (reader == null && source instanceof StreamSource) {
//createXMLStreamReader from Source is optional, we'll try and map it
StreamSource ss = (StreamSource)source;
if (ss.getInputStream() != null) {
reader = factory.createXMLStreamReader(ss.getSystemId(),
ss.getInputStream());
} else {
reader = factory.createXMLStreamReader(ss.getSystemId(),
ss.getReader());
}
}
return reader;
} finally {