You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Morley Howell <mo...@orbiscommunications.com> on 2004/01/15 18:15:47 UTC

Bug in Transformer?

Hi all,

It appears that the AbstractDOMTransformer (ADT) has a bug in the way it
handles SAX events. If it receives multiple calls to characters() between
calls to startElement() and endElement(), the DOM Node that it produces only
has the data from the first call to characters(), and the data from the rest
of the calls to characters() is lost.

One way to duplicate this problem is to set up an XSLT transform that
outputs a single tag whose value is generated by multiple xsl:value-of tags.
This causes the condition of multiple calls to characters(), and the problem
ensues if you use the ADT downstream of the xslt transformer. The problem
also occurs if you use the session transformer in a similar way, ie. output
a single tag whose value is generated by multiple session:getxml tags. See
the thread 'Losing XML data in the pipeline' on this list for an example.

I'm not sure that this is a bug in Cocoon itself, or whether it might be a
bug in Xerces, Xalan, or even the JRE. Can anyone shed any light on this?

Thanks,

Morley


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


Re: Bug in Transformer?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.01.2004 19:38, Morley Howell wrote:

> Ok good, someone else is seeing this, so I'm not going crazy!
> 
> I tried the concat in my stylesheet and it worked - thanks a million Jorg!
> 
> I view this as a work-around though. You would still have the problem if you
> were using the session transformer, since there is no concat capability
> there. I don't know much about SAX, but I believe that having multiple calls
> to characters() for a single element is valid. If so, then this looks like a
> bug to me.

Yes, it looks like a bug. Can you add it to bugzilla including the 
simple testcase of XSLT and a DOM transformer?

> PS: Apologies for the duplicate post, I realized that I was not subscribed
> to the list with the email address I'm using at the moment, so I thought the
> first post wouldn't go through.

If you write a mail without being subscribed a list moderator gets a 
warning. He reads your mail and decides whether he lets it through or not.

Joerg

>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org]On Behalf Of Jorg Heymans
>>
>>
>>I can confirm this behaviour. I got around it by using concat in my
>>stylesheet to cat the nodes into one node.
>>
>>Whether it's a bug or feature i don't know.
>>
>>
>>
>>Morley Howell wrote:
>>
>>>Hi all,
>>>
>>>It appears that the AbstractDOMTransformer (ADT) has a bug in the way it
>>>handles SAX events. If it receives multiple calls to
>>
>>characters() between
>>
>>>calls to startElement() and endElement(), the DOM Node that it
>>
>>produces only
>>
>>>has the data from the first call to characters(), and the data
>>
>>from the rest
>>
>>>of the calls to characters() is lost.
>>>
>>>One way to duplicate this problem is to set up an XSLT transform that
>>>outputs a single tag whose value is generated by multiple
>>
>>xsl:value-of tags.
>>
>>>This causes the condition of multiple calls to characters(),
>>
>>and the problem
>>
>>>ensues if you use the ADT downstream of the xslt transformer.
>>
>>The problem
>>
>>>also occurs if you use the session transformer in a similar
>>
>>way, ie. output
>>
>>>a single tag whose value is generated by multiple
>>
>>session:getxml tags. See
>>
>>>the thread 'Losing XML data in the pipeline' on this list for
>>
>>an example.
>>
>>>I'm not sure that this is a bug in Cocoon itself, or whether it
>>
>>might be a
>>
>>>bug in Xerces, Xalan, or even the JRE. Can anyone shed any
>>
>>light on this?
>>
>>>Thanks,
>>>
>>>Morley


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


RE: Bug in Transformer?

Posted by Morley Howell <mo...@orbiscommunications.com>.
Ok good, someone else is seeing this, so I'm not going crazy!

I tried the concat in my stylesheet and it worked - thanks a million Jorg!

I view this as a work-around though. You would still have the problem if you
were using the session transformer, since there is no concat capability
there. I don't know much about SAX, but I believe that having multiple calls
to characters() for a single element is valid. If so, then this looks like a
bug to me.

Morley

PS: Apologies for the duplicate post, I realized that I was not subscribed
to the list with the email address I'm using at the moment, so I thought the
first post wouldn't go through.

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Jorg Heymans
> Sent: Thursday January 15, 2004 12:24 PM
> To: users@cocoon.apache.org
> Subject: Re: Bug in Transformer?
>
>
> I can confirm this behaviour. I got around it by using concat in my
> stylesheet to cat the nodes into one node.
>
> Whether it's a bug or feature i don't know.
>
>
>
> Morley Howell wrote:
> > Hi all,
> >
> > It appears that the AbstractDOMTransformer (ADT) has a bug in the way it
> > handles SAX events. If it receives multiple calls to
> characters() between
> > calls to startElement() and endElement(), the DOM Node that it
> produces only
> > has the data from the first call to characters(), and the data
> from the rest
> > of the calls to characters() is lost.
> >
> > One way to duplicate this problem is to set up an XSLT transform that
> > outputs a single tag whose value is generated by multiple
> xsl:value-of tags.
> > This causes the condition of multiple calls to characters(),
> and the problem
> > ensues if you use the ADT downstream of the xslt transformer.
> The problem
> > also occurs if you use the session transformer in a similar
> way, ie. output
> > a single tag whose value is generated by multiple
> session:getxml tags. See
> > the thread 'Losing XML data in the pipeline' on this list for
> an example.
> >
> > I'm not sure that this is a bug in Cocoon itself, or whether it
> might be a
> > bug in Xerces, Xalan, or even the JRE. Can anyone shed any
> light on this?
> >
> > Thanks,
> >
> > Morley
>
>
> ---------------------------------------------------------------------
> 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


Re: Bug in Transformer?

Posted by Jorg Heymans <jh...@domek.be>.
I can confirm this behaviour. I got around it by using concat in my 
stylesheet to cat the nodes into one node.

Whether it's a bug or feature i don't know.



Morley Howell wrote:
> Hi all,
> 
> It appears that the AbstractDOMTransformer (ADT) has a bug in the way it
> handles SAX events. If it receives multiple calls to characters() between
> calls to startElement() and endElement(), the DOM Node that it produces only
> has the data from the first call to characters(), and the data from the rest
> of the calls to characters() is lost.
> 
> One way to duplicate this problem is to set up an XSLT transform that
> outputs a single tag whose value is generated by multiple xsl:value-of tags.
> This causes the condition of multiple calls to characters(), and the problem
> ensues if you use the ADT downstream of the xslt transformer. The problem
> also occurs if you use the session transformer in a similar way, ie. output
> a single tag whose value is generated by multiple session:getxml tags. See
> the thread 'Losing XML data in the pipeline' on this list for an example.
> 
> I'm not sure that this is a bug in Cocoon itself, or whether it might be a
> bug in Xerces, Xalan, or even the JRE. Can anyone shed any light on this?
> 
> Thanks,
> 
> Morley


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