Ben Anderson wrote: > public void endTransformingElement( String uri, > String name, > String raw ) > throws ProcessingException, IOException, SAXException { > if(XQUERY_TAG.equals(name)) { > String xq = "<hello>ben</hello>"; > try { > XMLReader parser = XMLReaderFactory.createXMLReader(); > parser.setContentHandler(this.contentHandler); > parser.parse(new InputSource(new StringReader(xq))); > > the problem is that when the parse method is run, the > endDocument method of the contentHandler is called, and I > don't think it should be? I created another transformer to > go after this one just to log the events being called, which > led me to this conclusion. So, the contentHandler's > endDocument method is getting called twice... once in the > parse method, and once when it should be. Does anyone know > why this is happening and how I might change it?
Use EmbeddedXMLPipe to pipe between the parser and this.contentHandler. This will discard the "document" SAX events. http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/xml/EmbeddedXMLPi pe.html Cheers Con --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]