RE: [xsl] XPATH: Can not convert #STRING to a NodeList!

Subject: RE: [xsl] XPATH: Can not convert #STRING to a NodeList!
From: "Palaniappan, Krishnasamy" <PalaniK@xxxxxxxxxxx>
Date: Fri, 22 Dec 2000 08:34:03 -0500
Thanks, Gordon. However, 
		<xsl:value-of select="$b_level_total/CNT"/>
seems to work fine!? Basically, it does not take the string but it picks the entire node and then goes one step down to the CNT node.

I am using Xerces 1.2.1, Xalan 1.2.1 and fop 0.15. Do you know of any extension functions and do i need to download something to be able to make use of them?

Thanks for your inputs,
Regards,
Krish

-----Original Message-----
From: Weakliem, Gordon [mailto:Gordon.Weakliem@xxxxxxxxxxxxxxx]
Sent: Thursday, December 21, 2000 6:04 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: PalaniK@xxxxxxxxxxx
Subject: RE: [xsl] XPATH: Can not convert #STRING to a NodeList!


You can't use a variable as a select expression:
	<xsl:value-of select="$b_level_total/CNT"/>
is illegal, as are the other uses of $b_level_total in your example.

Off the top of my head, select each value with $b_level_total and pass them
in as parameters.  Some parsers have extension functions that allow you to
select using a variable.  

> -----Original Message-----
> From: Palaniappan, Krishnasamy [mailto:PalaniK@xxxxxxxxxxx]
> Sent: Thursday, December 21, 2000 12:52 PM
> To: 'xslt'
> Subject: [xsl] XPATH: Can not convert #STRING to a NodeList!
> 
> 
> Hi,
> 
> Why is this not working?
> 
> <xsl:template name="values_SUST">
>  <xsl:param name="b_level_total"/>
>  <xsl:param name="category"/>
>  <xsl:param name="bcolor"/>
> 
>   <fo:table-row background-color="white">
>    <fo:table-cell>
>     <fo:block>
>     </fo:block>
>    </fo:table-cell>
>   <fo:table-cell border-width="1pt" padding-before="2pt">
>    <fo:block font-size="6pt" color="$bcolor" text-align="center">
>     <xsl:choose>
>      <xsl:when test="$category=TDES">
>       <xsl:value-of select="TDES"/>
>      </xsl:when>
>      <xsl:when test="$category=SUB-TOTAL">
>       SUB-TOTAL
>      </xsl:when>
>      <xsl:when test="$category=TOTAL">
>       TOTAL
>      </xsl:when>
>     </xsl:choose>
>    </fo:block>
>   </fo:table-cell>
>   <fo:table-cell border-width="1pt" padding-before="2pt">
>    <fo:block font-size="6pt" color="$bcolor" text-align="center">
>     <xsl:value-of select="$b_level_total/CNT"/>
>    </fo:block>
>   </fo:table-cell>
>   <fo:table-cell border-width="1pt" padding-before="2pt">
>    <xsl:variable name="amt">
>     <xsl:value-of select="$b_level_total/AMT"/>
>    </xsl:variable>
>    <fo:block font-size="6pt" color="$bcolor" text-align="center">
>     <xsl:value-of select="format-number($amt,'#,###.00')"/>
>    </fo:block>
>   </fo:table-cell>
>   <fo:table-cell border-width="1pt" padding-before="2pt">
>    <xsl:variable name="fee">
>     <xsl:value-of select="$b_level_total/FEE"/>
>    </xsl:variable>
>    <fo:block font-size="6pt" color="$bcolor" text-align="center">
>     <xsl:value-of select="format-number($fee,'#,###.00')"/>
>    </fo:block>
>   </fo:table-cell>
>   <fo:table-cell border-width="1pt" padding-before="2pt">
>    <xsl:variable name="tot">
>     <xsl:value-of select="$b_level_total/TOT"/>
>    </xsl:variable>
>    <fo:block font-size="6pt" color="$bcolor" text-align="center">
>     <xsl:value-of select="format-number($tot,'#,###.00')"/>
>    </fo:block>
>   </fo:table-cell>
>  </fo:table-row>
> 
> </xsl:template>
> 
> I call this template using:
> 	<xsl:call-template name="values_SUST">
>                       <xsl:with-param name="b_level_total" 
> select="'B4TOTAL'"/>
>                        <xsl:with-param name="category" 
> select="'TDES'"/>
>                        <xsl:with-param name="bcolor" 
> select="'black'"/> 
>             </xsl:call-template>
> 
> 
> what I desire is:
> The template values_SUST needs to be called with 3 string 
> arguments ("B4TOTAL","TDES","black"). While "black" should 
> become the color in the template, B4TOTAL and TDES are 
> actually nodes. Can I not do this?
> 
> Thanks,
> Krish
> 
> p.s.: I have subscribed to the digest and is there any way I 
> can get the responses sooner than tomorrow?
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread