cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <benanderson...@gmail.com>
Subject Re: custom transformer
Date Wed, 09 Mar 2005 03:03:29 GMT
beautiful - thanks!


On Wed, 9 Mar 2005 15:00:18 +1300, Conal Tuohy <Conal.Tuohy@vuw.ac.nz> wrote:
> 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message