[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Using copy to change a node, whilst retaining the attributes


Subject: RE: [xsl] Using copy to change a node, whilst retaining the attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 5 Aug 2003 00:05:57 +0100

apply-templates requires a node set as the value of its select
attribute, but:

	<xsl:apply-template select="not(ancestor::player/@pword=$pmkey
and @ID &gt;= $from and @ID &lt;= $to)"

assuming the missing /> is really there at the end selects a boolean
value so either true() or false(0 this isn't a node set and should
generate a run time error whatever value is returned.

I think that inside the xsl:copy you want

<xsl:choose>
 <xsl:when test="ancestor::player/@pword=$pmkey
                and @ID &gt;= $from and @ID &lt;= $to">
  <xsl:value-of select="$type"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>

don't you?

David

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



Current Thread