* Generate XML data.
*/
public void generate()
throws IOException, SAXException, ProcessingException {
try {
NekoHtmlSaxParser parser = new NekoHtmlSaxParser(this.properties);
InputSource saxSource;
if (this.requestParameterValue != null) {
saxSource = new InputSource(new StringReader(this.requestParameterValue));
}
else {
if (inputSource != null) {
requestStream = this.inputSource.getInputStream();
}
saxSource = new InputSource(requestStream);
}
if (xpath != null) {
DOMBuilder builder = new DOMBuilder();
parser.setContentHandler(builder);
parser.parse(saxSource);
Document doc = builder.getDocument();
DOMStreamer domStreamer = new DOMStreamer(this.contentHandler,
this.lexicalHandler);
this.contentHandler.startDocument();
NodeList nl = processor.selectNodeList(doc, xpath);
int length = nl.getLength();
for(int i=0; i < length; i++) {
domStreamer.stream(nl.item(i));
}
this.contentHandler.endDocument();
} else {
parser.setContentHandler(this.contentHandler);
parser.parse(saxSource);
}
} catch (IOException e){
throw new ResourceNotFoundException("Could not get resource "
+ this.inputSource.getURI(), e);
} catch (SAXException e){