/** * Actually invoke the tag body to generate the SAX events * * @throws SAXException - * Any SAX exception, possibly wrapping another exception. */ private void doInvokeBody() throws SAXException { try { if (this.shouldParseBody()) { XMLReader anXMLReader = XMLReaderFactory.createXMLReader(); anXMLReader.setContentHandler(this.xmlOutput); anXMLReader.setProperty(LEXICAL_HANDLER_PROPERTY,this.xmlOutput); StringWriter writer = new StringWriter(); this.tag.invokeBody(XMLOutput.createXMLOutput(writer)); Reader reader = new StringReader(writer.toString()); anXMLReader.parse(new InputSource(reader)); } else { this.tag.invokeBody(this.xmlOutput); } } catch (Exception ex) { throw new SAXException(ex); } }