This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: accessing last element of node set passed as parameter


Hello Paul,

you're again creating a RTF and must convert it to a node-set. Either in 
your "A" template or by changing the apply-templates again:

<xsl:variable name="tmp">
   <xsl:copy-of select="$result"/>
   <BAR i="{$i}"/>
</xsl:variable>
<xsl:apply-templates select="following-sibling::*[1]">
   <xsl:with-param name="result" select="xalan:nodeset($tmp)"/>
</xsl:apply-templates>

Regards,

Joerg

paul morgan schrieb:
> Thanks David!  Some of this is starting to click ... but then again something happens that shuts the clicker down.
> 
> Since order is important to me, I decided to heed your warning about the ordering of a union being implementation dependent, so I set about making all of the "BAR" elements be siblings of one another.  I replaced:
> 
>     <xsl:apply-templates select="following-sibling::*[1]">
>         <xsl:with-param name="result" select="$result|xalan:nodeset($new)"/>
>     </xsl:apply-templates> </xsl:template> 
> 
> with:
> 
>     <xsl:apply-templates select="following-sibling::*[1]">
>         <xsl:with-param name="result">
>             <xsl:copy-of select="$result"/>
>             <BAR i="{$i}"/>
>         </xsl:with-param>
>     </xsl:apply-templates> </xsl:template> 
> 
> but now I get the following error message:
> 
>     Can not convert #RTREEFRAG to a NodeList!
> 
> at the line:
> 
>     <xsl:copy-of select="($result/BAR)[last()]" />
> 
> the first time the "A" template is matched with a non-empty value for "result".  Shouldn't "result" be a node set?
> 
> Paul (I think this language is going to make my head explode)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]