You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ben Anderson <be...@gmail.com> on 2005/03/09 02:49:23 UTC
custom transformer
Hi,
I'm writing a custom transformer which extends AbstractSaxTransformer
(which I think is irrelevant to my question). I think my question is
geared more towards sax or perhaps xerces, but hopefully someone can
help...
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?
Thanks,
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org