130131132133134135136137138139
SAXContentHandler contentHandler = new SAXContentHandler(); XMLOutput output = new XMLOutput( contentHandler ); contentHandler.startDocument(); script.run(context, output); contentHandler.endDocument(); return contentHandler.getDocument(); } }
143144145146147148149150151152153
protected Document parseBody(XMLOutput output) throws Exception { SAXContentHandler handler = new SAXContentHandler(); XMLOutput newOutput = new XMLOutput(handler); handler.startDocument(); invokeBody( newOutput); handler.endDocument(); return handler.getDocument(); /* // the following is inefficient as it requires a parse of the text // but is left here in the code to see how it could be done.