You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gary Larsen <ga...@envisn.com> on 2007/01/21 22:40:48 UTC
Problem in custom Transformer (migrating to 2.1.10)
I'm now trying the dev-list for this. Thanks for any ideas.
I'm upgrading Cocoon from 2.1.7 to 2.1.10 and having a problem with a custom
transformer.
The transformer is not sending events back to the pipeline. Putting a
LogTransformer before the custom transformer logs events, but when using it
after no events are logged.
The transformer is maybe to simple for 2.1.10?
public class NamespaceDecoratorTransformer extends AbstractTransformer {
private SaxDecorator decorator = null;
public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
throws ProcessingException, SAXException, IOException {
if (super.contentHandler != null) {
this.decorator = new SaxDecorator(super.contentHandler);
}
}
SaxDecorator is a java ContentHandler which just adds uri info to elements.
>From the application log I can see both classes handling events:
DEBUG 64406 [http-8080-Processor25] SaxDecorator: startDocument called
DEBUG 64406 [http-8080-Processor25] NamespaceDecoratorTransformer:
startDocument() called
DEBUG 64547 [http-8080-Processor25] NamespaceDecoratorTransformer:
startElement() called - loc:userSession
DEBUG 64547 [http-8080-Processor25] SaxDecorator: startElement -
localName:userSession
DEBUG 64547 [http-8080-Processor25] NamespaceDecoratorTransformer:
startElement() called - loc:adminLoggedOn
DEBUG 64547 [http-8080-Processor25] SaxDecorator: startElement -
localName:adminLoggedOn
DEBUG 64562 [http-8080-Processor25] NamespaceDecoratorTransformer:
startElement() called - loc:appStatus
DEBUG 64562 [http-8080-Processor25] SaxDecorator: startElement -
localName:appStatus
This works fine in 2.1.7.
Thanks,
Gary
Re: Problem in custom Transformer (migrating to 2.1.10)
Posted by Joerg Heinicke <jo...@gmx.de>.
For reference what already has been suggested:
http://marc.theaimsgroup.com/?t=116922925500001&r=1&w=4.
Jörg
On 21.01.2007 22:40, Gary Larsen wrote:
> I'm now trying the dev-list for this. Thanks for any ideas.
>
> I'm upgrading Cocoon from 2.1.7 to 2.1.10 and having a problem with a custom
> transformer.
>
> The transformer is not sending events back to the pipeline. Putting a
> LogTransformer before the custom transformer logs events, but when using it
> after no events are logged.
>
> The transformer is maybe to simple for 2.1.10?
>
> public class NamespaceDecoratorTransformer extends AbstractTransformer {
>
> private SaxDecorator decorator = null;
>
> public void setup(SourceResolver resolver, Map objectModel, String src,
> Parameters par)
> throws ProcessingException, SAXException, IOException {
>
> if (super.contentHandler != null) {
> this.decorator = new SaxDecorator(super.contentHandler);
> }
> }
>
> SaxDecorator is a java ContentHandler which just adds uri info to elements.
>>>From the application log I can see both classes handling events:
>
> DEBUG 64406 [http-8080-Processor25] SaxDecorator: startDocument called
> DEBUG 64406 [http-8080-Processor25] NamespaceDecoratorTransformer:
> startDocument() called
> DEBUG 64547 [http-8080-Processor25] NamespaceDecoratorTransformer:
> startElement() called - loc:userSession
> DEBUG 64547 [http-8080-Processor25] SaxDecorator: startElement -
> localName:userSession
> DEBUG 64547 [http-8080-Processor25] NamespaceDecoratorTransformer:
> startElement() called - loc:adminLoggedOn
> DEBUG 64547 [http-8080-Processor25] SaxDecorator: startElement -
> localName:adminLoggedOn
> DEBUG 64562 [http-8080-Processor25] NamespaceDecoratorTransformer:
> startElement() called - loc:appStatus
> DEBUG 64562 [http-8080-Processor25] SaxDecorator: startElement -
> localName:appStatus
>
> This works fine in 2.1.7.
>
> Thanks,
> Gary