| 
 
Subject: Re: [xsl] sorting and selecting the last value From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Thu, 08 Aug 2002 22:55:22 +0200  | 
<xsl:variable name="foo"> <xsl:value-of select="bar"/> </xsl:variable>
<xsl:variable name="last-field-value">
  <xsl:for-each select="$full_path[contains($dbs_searched, @db)]/*">
    <xsl:sort select="."/>
    <xsl:if test="position()=last()">
      <xsl:copy-of select="."/>
    </xsl:if>
  </xsl:for-each>
</xsl:variable>Hi,
I'm trying the access the last value of a sorted list but for some how, the system produces the error: Can not convert #RTREEFRAG to a NodeList.
Here is my codes:
<xsl:variable name='field_value'> <xsl:for-each select="$full_path[contains($dbs_searched, @db)]/*"> <xsl:sort select="."/> <xsl:for-each select="self::node()[not(.=following::node())]"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:for-each> </xsl:variable>
<xsl:variable name="lastval" select="$field_value[last()]" />
And the error poinrts to the last line: <xsl:variable name="lastval" select="$field_value[last()]" />
But if I do <xsl:variable name='field_value' select='$full_path[contains($dbs_searched, @db)]'/> everything works just fine.
Do you have some idea on what could cause the problem?
Thanks for your help.
Ming
| Current Thread | 
|---|
| <- Previous | Index | Next -> | 
|---|---|---|
| [xsl] sorting and selecting the las, Ming | Thread | Re: [xsl] sorting and selecting the, Ming Yu | 
| Re: [xsl] stripping leading and tra, Aparna Konduri | Date | Re: [xsl] stripping leading and tra, Mike Brown | 
| Month |