cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <>
Subject custom transformer
Date Wed, 09 Mar 2005 01:49:23 GMT
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

    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.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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message