Last post Feb 04, 2012 09:04 PM by Decker Dong - MSFT
Feb 03, 2012 10:38 AM|Beau_Damore|LINK
I have one query <query name="Products" rowElementName="Product"> (that I'm not touching) that uses a stock SP to get products to show.
I have another query <query name="ProductsToExclude" rowElementName="Product"> that gets productIDs that I want to exclude (depending on other factors in the DB.)
I have this is template
that spits out everything from query 1: Products/Product
Inside this template, I was trying to use something like this to determine if that particular product should show:
<xsl:if test="/root/ProductsToExclude/Product != ProductID"> <----but this is wrong
Since only the first query is 'looping' how do I test the Products from query 1, against EACH/EVERY productid from query 2?
<xsl:if test="/root/ProductsToExclude/@Product != ProductID">???
EDIT: OK, I have this so far: (close but no cigar) <xsl:template name="ProductCell"> <=- uses first query-= <xsl:variable name="Flag"> <xsl:for-each select="/root/ProductsToExclude/Product/ProductID"> <=-- this is from the second query I want ot look through-= <xsl:if test=". = ProductID"> 1 </xsl:if> </xsl:for-each> </xsl:variable> <xsl:if test="$Flag = ''">.....show product.... This isn't working tho.. any ideas?
Feb 04, 2012 09:04 PM|decker dong - msft|LINK
Well……Would you mind showing us your xml contents to be filtered with？
And tell us what's the result that you are now expecting？