You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Peter Brant <pm...@gmx.at> on 2004/01/21 03:44:53 UTC

Question on EffectPipe (bug?) + patch

Hi all,

There appears to be a bug (or maybe something unfinished?) in
EffectPipe.startPrefixMapping().  Line 426 is commented out (copy pasted in below).  This
causes EffectPipe.Output.startPrefixMapping() to send a null prefix and uri
down the pipe when called from EffectPipe.Output.copy() (which in my case
causes Saxon to throw an NPE).  Attached is a patch that fixes it (by passing in
input.prefix/uri instead). 

This fixes it for my use case, but I'm not entirely sure what was intended
(or why line 426 is commented out in the first place).

Thanks,

Peter

    public void startPrefixMapping(String prefix, String uri) throws
SAXException {
        input = new Element(prefix, uri);
        elements.addFirst(input);
        //this.prefix = prefix; this.uri = uri;
        event = EVENT_START_PREFIX_MAPPING; handler = handler.process();
    }

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail

Re: Question on EffectPipe (bug?) + patch

Posted by ti...@keow.org.
On Wed, Jan 21, 2004 at 03:44:53AM +0100, Peter Brant wrote:
> There appears to be a bug (or maybe something unfinished?) in
> EffectPipe.startPrefixMapping().  Line 426 is commented out (copy pasted in below).  This
> causes EffectPipe.Output.startPrefixMapping() to send a null prefix and uri
> down the pipe when called from EffectPipe.Output.copy() (which in my case
> causes Saxon to throw an NPE).  Attached is a patch that fixes it (by passing in
> input.prefix/uri instead). 

Thanks for spotting this.  Patch applied.

> This fixes it for my use case, but I'm not entirely sure what was intended
> (or why line 426 is commented out in the first place).

I was planning on eventually allowing multiple input sources, which
would imply wrapping all of the input data (prefix, uri, character data,
etc.) inside some variable like how the start and end element events are
already stored in "input".  Since I did not have a compelling use case
yet, I stopped working on this after dabbling with the prefix and uri,
and you caught the code in mid-transition.

--Tim Larson