XMLReader parser = XMLReaderFactory.createXMLReader(false);
XMLFilterImpl xmlFilter = new XMLFilterImpl(parser);
HTMLResponseConditioner conditioner = new HTMLResponseConditioner(xmlFilter);
XMLProcessImpl xmlProcess = new XMLProcessImpl() {
public void setDocumentLocator(Locator locator) {
XMLProcess consumer = getConsumerProcess();
if (null != consumer) {
consumer.setDocumentLocator(locator);
}
}
public void startDocument() throws SAXException {
XMLProcess consumer = getConsumerProcess();
if (null != consumer) {
consumer.startDocument();
}
}
public void endDocument() throws SAXException {
XMLProcess consumer = getConsumerProcess();
if (null != consumer) {
consumer.endDocument();
}
}
// Javadoc inherited
public void startPrefixMapping(String prefix, String uri)
throws SAXException {
XMLProcess consumer = getConsumerProcess();
if (null != consumer) {
consumer.startPrefixMapping(prefix, uri);
}
}
// Javadoc inherited
public void endPrefixMapping(String prefix) throws SAXException {
XMLProcess consumer = getConsumerProcess();
if (null != consumer) {
consumer.endPrefixMapping(prefix);
}
}
};
xmlProcess.setNextProcess(adapter);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[2048];
int readBytes = input.read(buffer);
while (readBytes != -1) {