p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: Problems with in


Message #1 by "Daniel Janesch" <daniel.janesch@i...> on Thu, 19 Jul 2001 10:59:28 +0200
Well, the first thing I notice is that you're calling getBool with a
parameter called "bool", whereas it's expecting one called "value".

And the next thing I notice is that the template getBoolToken takes exactly
the same action whether its parameter is true or false: so how can you tell
that getBool isn't being called?

If you still think there's a problem, show us the whole stylesheet and tell
us which processor you're using.

Mike Kay
Software AG

> -----Original Message-----
> From: Daniel Janesch [mailto:daniel.janesch@i...]
> Sent: 19 July 2001 09:59
> To: P2P_XSLT
> Subject: [xslt] Problems with <xsl:call-template ...> in
> <xsl:with-param
> ...>
>
>
> Hy!
>
> I have tried to do an call-template in an with-param but it
> did not work.
> The problem is that the second template (getBool) isn't called!!
>
> I have tryed it outside of with-param and it works!
>
> Why is this so?
>
> Could someone help me?
>
> Code:
>
> This is the part where I have the Problem:
>
>     <xsl:call-template name="getBoolToken">
>         <xsl:with-param name="value">
>             <xsl:call-template name="getBool">
>                 <xsl:with-param name="bool" select="$content"/>
>             </xsl:call-template>
>         </xsl:with-param>
>     </xsl:call-template>
>
>
> Here are the template:
>
> <xsl:template name="getBool">
>   <xsl:param name="value"/>
>
>   <xsl:variable name="TOK_YES" select="'yes'"/>
>   <xsl:variable name="TOK_JA" select="'ja'"/>
>   <xsl:variable name="TOK_WAHR" select="'wahr'"/>
>   <xsl:variable name="TOK_ONE" select="'1'"/>
>   <xsl:variable name="lowerCaseValue" select="translate
> ($value, 'AEHJRSTUWY',
> 'aehjrstuwy')"/>
>
>         <xsl:choose>
>             <xsl:when test="boolean ($value)">
>                 <xsl:value-of select="false ()"/>
>             </xsl:when>
>
>             <xsl:when test="$lowerCaseValue = $TOK_YES or
>                             $lowerCaseValue = $TOK_JA or
>                             $lowerCaseValue = $TOK_WAHR or
>                             $lowerCaseValue = true () or
>                             $value = $TOK_ONE">
>                 <xsl:value-of select="true ()"/>
>             </xsl:when>
>
>             <xsl:otherwise>
>                 <xsl:value-of select="false ()"/>
>             </xsl:otherwise>
>         </xsl:choose> <!-- choose -->
>  </xsl:template> <!-- getBool -->
>
>
>
>  <xsl:template name="getBoolToken">
>     <xsl:param name="bool"/>
>
>     <xsl:choose>
>         <xsl:when test="$bool">
>             <xsl:value-of select="gp_TOK_FALSE"/>
>         </xsl:when>
>
>         <xsl:otherwise>
>             <xsl:value-of select="gp_TOK_FALSE"/>
>         </xsl:otherwise>
>     </xsl:choose> <!-- choose -->
> </xsl:template> <!-- getBoolToken -->
>
> Thanks a lot und bye Daniel
>
>
> ---
> When you work at Microsoft, you don't have to wait for the
> latest technologies to be released. You'll create them ? with
> XML, SOAP, and C# -- and help decide what happens next.
> Find out where your career can take you: take a look at our
> software design engineer opportunities at
> http://www.microsoft.com/jobs.
>


  Return to Index