Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: XSL:if testing for a value in one query/template with values from another.

  1. #1
    bdamore is offline Member
    Join Date
    Jun 2011
    Posts
    52

    Default XSL:if testing for a value in one query/template with values from another.

    Hello,
    I have two queries on one custom xml package.
    One get's the products using the stock aspdnsf_GetProducts SP. the second I want to use to filter out products from the first.
    First query uses a template to spit out the records/HTML.
    I want to use something like:

    <xsl:if test="/root/ProductsToExclude/Product != ProductID">
    (second query) ------- != -------------- node in first query/template.

    I feel that inside this first template, it's 'looping' each product out but the second query values aren't all being checked, only the first value, is this correct?

    How do I obtain the desired result of checking every ProductID from the template/query1 against ALL/EVERY value in the second query?

    Thanks


    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-=
    <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?
    Last edited by bdamore; 02-03-2012 at 09:50 AM.

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Have you verified that the data you want to check is being returned in the XML by turning on debug mode?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM