I need to get a StreamSource from my xml file, however I also need to use a custom EntityResolver.
The problem I am having is that I cannot figurout how to get an XMLReader into my stream source.
I am doing the following: (doc is an InputStream)
XMLReader reader = XMLReaderFactory.createXMLReader();
StreamSource doc_source = new StreamSource(doc);
reader.setEntityResolver(new PsudoEntityResolver());
doc_source.setReader(reader);
Obviously this does not work because setReader() accepts a Reader as its argument and not an XMLReader.
Any ideas how I can get around this.
Use your XMLReader, set the entity resolver as you are, but then call: