troubleshooting Question

Adding a new filter into XSL project

Avatar of mavmanau
mavmanauFlag for Australia asked on
Web Languages and StandardsXMLJavaScript
9 Comments1 Solution606 ViewsLast Modified:
Hi Guys,

Thank you for taking the time to take a look at my question, your assistance is most appreciated.  

Take the sample XML below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <row>
            <LoanNo>132138</LoanNo>
            <Method>Direct Debit</Method>
            <Status>Cleared</Status>
            <Cleared>241.38</Cleared>
            <DateSched>40210</DateSched>
            <Out_Interest>87.75</Out_Interest>
            <Out_Charges>55</Out_Charges>
            <Out_Costs>0</Out_Costs>
            <In_Actual>100.00</In_Actual>
            <Curr_Balance>-26.37</Curr_Balance>
            <Brand>FSM</Brand>
            <Product>NULL</Product>
            <Lead_Gen>Web FSM</Lead_Gen>
            <Broker_Code_ID>JSF0177667</Broker_Code_ID>
            <Broker_Code>FB - 01</Broker_Code>
            <Funded>40127.6845356134</Funded>
            <Request>325</Request>
            <Offer>325</Offer>
            <Title>Miss</Title>
            <First_Name>TEST</First_Name>
            <Middle_Name>TEST</Middle_Name>
            <Surname>TEST</Surname>
            <DOB>18209</DOB>
            <Email>test@hotmail.com</Email>
            <State>Western Australia</State>
            <Pay_Frequency>Fortnightly</Pay_Frequency>
            <RLD>NULL</RLD>
            <Home_Phone>07555555555</Home_Phone>
            <Mobile_Phone>07555555555</Mobile_Phone>
            <Loan_Status>Defaulted</Loan_Status>
            <Age_of_Loan>580.315464386571</Age_of_Loan>
            <Days_Ago>498</Days_Ago>
            <Loan_Funded>10/11/2009</Loan_Funded>
      </row>
</document>

to filter the product  - I build a selection box and populate it on the fly with all different products.  Below is the code that I use.

 <xsl:for-each select="/document/row[generate-id() = generate-id(key('product', Product)[1])]">
                        <listproductrow name="Product_{Product}" pvalue="{Product}">
                            <xsl:attribute name="selected">
                                <xsl:if test="Product = $product">
                                    <xsl:text>yes</xsl:text>
                                </xsl:if>
                            </xsl:attribute>
                        </listproductrow>
                    </xsl:for-each>

What I want to do, is to add a select box that has three options:
Never Paid (when In_Actual = 0)
Paid (When In_Actual > 0)
All (all of the above)

how would I go about this?  would I send select box value back to a javascript function then do a transform, or is there a way I can do it without sending the value out to javascript?

Any light you could shine on my question, I would be most appreciative!!
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)
Information Architect
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros