1 Reply Latest reply on Jun 13, 2013 7:59 PM by odie_63

    xslt multi conditions checking.

    user12679330

           Hi,

       

      Please could you help me how I can achieve my requireemnt through xslt.

      in an xml, I will pass the belwo records

       

      <Main>

      <HOME RecNo="1">

                    <Articles useFilter="True"    CID="LGTS22"   BVal="MUG"/>

                  <Articles useFilter="False"     CID="LGTS22"    BVal="MUG"/>

      </HOME>

       

      <HOME RecNo="2">

                    <Articles useFilter="False"  CID="LGTS22"    BVal="BBB"/>

                  <Articles useFilter="True"    CID="XXX"    BVal="MUG"  BID="LGTS22"  />

      </HOME>

       

      <HOME RecNo="3">

                    <Articles useFilter="False"  CID="ABCS22"    BVal="MUG"/>

                  <Articles useFilter="True"    CID="XXX"    BVal="MUG"  BID="ABCS22"  />

      </HOME>

       

      </Main>

       

      My requirement is like this.

       

      I will be passign the Home record to the xslt. in the xslt I need to check like this, based on Bval and useFilter I need to check the CID/BID values, as mentioned below.

       

      1. in the articles element if Bval is MUG, then check the value of UseFilter, if the useFilter is False then check the value of CID which is having  'LGT' value in it. then return the value as it is LGT. (first record)

      2. in the articles element if Bval is MUG, then check the value of UseFilter, if the useFilter is True then check the value of BID, not the CID attribute value which is having  'LGT' value in it. then return the value as it is LGT. (second record)

      3. If both above condtions are not met then return as nonLGT.(third record)

       

      Thanks.