cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Bug in newest cvs esql
Date Wed, 17 Jan 2001 04:22:34 GMT
On Tue, 16 Jan 2001, Matthew Cordes wrote:

> There is a bug in the newest esql logicsheet on or about line 710.
> get-string which calls get-string-encoded checks for an esql:encoding
> child then calls get-nested-content with it as a param.
>
> Here is the applicable code fragment:
>
> <xsl:variable name="encoding"><xsl:call-template name="get-nested-string"><xsl:with-param
name="content" select="esql:encoding"/></xsl:call-template></xsl:variable>
>
> <!-- added by me -->
> <xsl:message>encoding: '<xsl:value-of select="$encoding"/>'</xsl:message>
>
> <xsl:choose>
>   <xsl:when test="$encoding">
>     new String (<xsl:value-of select="$resultset"/>.getBytes
>       (<xsl:value-of select="$column-spec"/>), <xsl:value-of select="$encoding"/>)
>   </xsl:when>
>   <xsl:otherwise>
>     <xsl:value-of select="$resultset"/>.getString(<xsl:value-of select="$column-spec"/>)
>   </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
>
>
> The choose above always chooses the <xsl:when> option because even when
> <esql:encoding/> is not specified $encoding evaluates to an empty java
> string (e.g. "" ).
>
> I solved the bug by changing the <xsl:when> (above) to
>
> <xsl:when test="$encoding and not(normalize-space(translate($encoding, '&#9;&#10;&#13;',
'   '))='&#34;&#34;')">
>
> but perhaps you have a more elegant solution.

my elegant solution was to test for the presence of esql:encoding instead
of the $encoding variable. i think it should solve the stupid problem,
thanks for pointing it out though - and let me know if my fix is
boneheaded.

- donald


Mime
View raw message