RE: [xsl] How to copy filtered rows from a nodeset

Subject: RE: [xsl] How to copy filtered rows from a nodeset
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 14 May 2009 13:42:23 +0100
> I'm not able to get the following to work.

Presumably you mean that it doesn't return the result that you want. 

To help you understand why, we rather need to see (a) what the input is, and
(b) what output you want.

Note also, in pure XSLT 1.0 you can't use a result tree fragment (that is,
your variable $filteredrows) for further processing. Many processors have an
extension function xx:node-set() to get over this restriction.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


 Could 
> you please tell what the problem is.
>  
> XSL processor -- .net 2.0
> xsl stylesheet version 1.0
>  
>  
> <xsl:variable name="filteredrows">
>     <root>
>      <xsl:for-each select="$Rows">
> 
>       <xsl:variable name="product" select="@Product"></xsl:variable>
>       <xsl:variable name="bitteam"
> select="/dsQueryResponse/Products_Inventory/Rows/Row[@Title=$p
> roduct]/@T
> eam_x0020_Name"></xsl:variable>
> 
>       <xsl:variable name="varPTeam">
>            <xsl:call-template name="replace-string">
>                 <xsl:with-param name="text" select="$bitteam"/>
>                 <xsl:with-param name="replace" select="'amp;'"/>
>                 <xsl:with-param name="with" select="''"/>
>            </xsl:call-template>
>       </xsl:variable>
>  
>       <xsl:if test="$Team2=$varPTeam">
>       
>            <xsl:copy-of select="." />
>       
>       </xsl:if>
>      </xsl:for-each>
>     </root>
>    </xsl:variable>
> 
> Thanks in advance
> Reshma.
> 
> --------------------------------------------------------------
> ------------
> NOTICE: If received in error, please destroy and notify 
> sender. Sender does not intend to waive confidentiality or 
> privilege. Use of this email is prohibited when received in 
> error. Morgan Stanley may monitor and store emails to the 
> extent permitted by applicable law.

Current Thread