Newbie question...

Hello I am trying to test a value in a node and make a decision to create a
checkbox or a radio button based on the value.  When I run my code all the
results come back with a checkbox.
 
Can someone please tell me where I am going wrong?
 
Here is the code:
[XML]
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
  <!DOCTYPE QUOTE_SUMMARY (View Source for full doctype...)> 
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> -
<QUOTE_SUMMARY>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <REQUEST>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <HD>
  <SRC>NET</SRC> 
  <SVR>INTERNET</SVR> 
  </HD>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <DT>
  <D>20030917</D> 
  <T>141906</T> 
  <D2>20030917</D2> 
  <T2>141900</T2> 
  </DT>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <AC>
  <AGC>VOYTEST</AGC> 
  <AG>VYPUBLIC</AG> 
  <UN>VOYAGEUR</UN> 
  </AC>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <RQ>
  <TRX>I00000000115916</TRX> 
  <TY>Q</TY> 
  <REF>RF2803961</REF> 
  <LAN>en</LAN> 
  </RQ>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <TP>
  <DEP>20031010</DEP> 
  <RET>20031020</RET> 
  <ORG>ON</ORG> 
  <DES>LAX</DES> 
  <DAYS>11</DAYS> 
  </TP>
  </REQUEST>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <VERSION>
  <VERS>1.0</VERS> 
  </VERSION>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <ADDRESS>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FA>
  <U>*</U> 
  <A3>ON</A3> 
  </FA>
  </ADDRESS>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <PASSENGERS>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FI>
  <U>01</U> 
  <S>LASKDJF</S> 
  <F>ASLKDFJ</F> 
  <B>20000612</B> 
  <TE>N</TE> 
  </FI>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FI>
  <U>02</U> 
  <S>LASKDJF</S> 
  <F>SKSDKJF</F> 
  <B>20020703</B> 
  <TE>N</TE> 
  </FI>
  </PASSENGERS>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <PRODUCTS>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FC>
  <U>*</U> 
  <C>PT</C> 
  <NAME>Deluxe Package</NAME> 
  <V1>1500</V1> 
  <V2>99999999</V2> 
  <COMM>$84.25</COMM> 
  <PREM>$198.00</PREM> 
  <TAX>$15.84</TAX> 
  </FC>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FC>
  <U>*</U> 
  <C>NT</C> 
  <NAME>Non-Medical Package</NAME> 
  <V1>1500</V1> 
  <V2>99999999</V2> 
  <COMM>$68.93</COMM> 
  <PREM>$162.00</PREM> 
  <TAX>$12.96</TAX> 
  </FC>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FC>
  <U>*</U> 
  <C>IT</C> 
  <NAME>Standard Package</NAME> 
  <V1>1500</V1> 
  <V2>2000</V2> 
  <COMM>$79.99</COMM> 
  <PREM>$188.00</PREM> 
  <TAX>$15.04</TAX> 
  </FC>
 <https://www1.worldprotect.com/cgi-bin/rbaccess/rbcgilf00#> - <FC>
  <U>*</U> 
  <C>CAR</C> 
  <NAME>Rental Car Physical Damage</NAME> 
  <V1>20031010</V1> 
  <V2>20031020</V2> 
  <COMM>$58.51</COMM> 
  <PREM>$137.50</PREM> 
  <TAX>$0.00</TAX> 
  </FC>
  </PRODUCTS>
  </QUOTE_SUMMARY>
 
[SOURCE VIEW of XML]
<?xml version='1.0' encoding="ISO-8859-1"?>
<!DOCTYPE QUOTE_SUMMARY [
<!ELEMENT QUOTE_SUMMARY (REQUEST, VERSION, RP?, ADDRESS, PASSENGERS,
PRODUCTS)>
<!ELEMENT REQUEST (HD, DT, AC, RQ, TP)>
<!ELEMENT HD (SRC, SVR)>
<!ELEMENT SRC (#PCDATA)>
<!ELEMENT SVR (#PCDATA)>
<!ELEMENT DT (D, T, D2, T2)>
<!ELEMENT D (#PCDATA)>
<!ELEMENT T (#PCDATA)>
<!ELEMENT D2 (#PCDATA)>
<!ELEMENT T2 (#PCDATA)>
<!ELEMENT AC (AGC, AG, UN)>
<!ELEMENT AGC (#PCDATA)>
<!ELEMENT AG (#PCDATA)>
<!ELEMENT UN (#PCDATA)>
<!ELEMENT RQ (TRX, TY, REF, LAN)>
<!ELEMENT TRX (#PCDATA)>
<!ELEMENT TY (#PCDATA)>
<!ELEMENT REF (#PCDATA)>
<!ELEMENT LAN (#PCDATA)>
<!ELEMENT TP (DEP, RET, ORG, DES, DAYS)>
<!ELEMENT DEP (#PCDATA)>
<!ELEMENT RET (#PCDATA)>
<!ELEMENT DES (#PCDATA)>
<!ELEMENT ORG (#PCDATA)>
<!ELEMENT DAYS (#PCDATA)>
<!ELEMENT VERSION (VERS)>
<!ELEMENT VERS (#PCDATA)>
<!ELEMENT RP (ERT?,ERS?,ERN)>
<!ELEMENT ERT (#PCDATA)>
<!ELEMENT ERS (#PCDATA)>
<!ELEMENT ERN (#PCDATA)>
<!ELEMENT ADDRESS (FA)>
<!ELEMENT FA (U, A3)>
<!ELEMENT U (#PCDATA)>
<!ELEMENT A3 (#PCDATA)>
<!ELEMENT PASSENGERS (FI+)>
<!ELEMENT FI (FN?, U, S, F, B, TE, Q1?, Q2?)>
<!ELEMENT FN (#PCDATA)>
<!ELEMENT S (#PCDATA)>
<!ELEMENT F (#PCDATA)>
<!ELEMENT B (#PCDATA)>
<!ELEMENT TE (#PCDATA)>
<!ELEMENT Q1 (#PCDATA)>
<!ELEMENT Q2 (#PCDATA)>
<!ELEMENT PRODUCTS (FC+)>
<!ELEMENT FC ((FN?| U), C, NAME, V1?, V2?, COMM, PREM, TAX)>
<!ELEMENT C (#PCDATA)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT V1 (#PCDATA)>
<!ELEMENT V2 (#PCDATA)>
<!ELEMENT COMM (#PCDATA)>
<!ELEMENT PREM (#PCDATA)>
<!ELEMENT TAX (#PCDATA)>
]>
<QUOTE_SUMMARY>
<REQUEST><HD><SRC>NET</SRC><SVR>INTERNET</SVR></HD><DT><D>20030917</D><T>141
906</T><D2>20030917</D2><T2>141900</T2></DT><AC><AGC>VOYTEST</AGC><AG>VYPUBL
IC</AG><UN>VOYAGEUR</UN></AC><RQ><TRX>I00000000115916</TRX><TY>Q</TY><REF>RF
2803961</REF><LAN>en</LAN></RQ><TP><DEP>20031010</DEP><RET>20031020</RET><OR
G>ON</ORG><DES>LAX</DES><DAYS>11</DAYS></TP></REQUEST>
<VERSION>
<VERS>1.0</VERS>
</VERSION>
<ADDRESS><FA><U>*</U><A3>ON</A3></FA></ADDRESS>
<PASSENGERS><FI><U>01</U><S>LASKDJF</S><F>ASLKDFJ</F><B>20000612</B><TE>N</T
E></FI><FI><U>02</U><S>LASKDJF</S><F>SKSDKJF</F><B>20020703</B><TE>N</TE></F
I></PASSENGERS>
<PRODUCTS><FC><U>*</U><C>PT</C><NAME>Deluxe
Package</NAME><V1>1500</V1><V2>99999999</V2><COMM>$84.25</COMM><PREM>$198.00
</PREM><TAX>$15.84</TAX></FC><FC><U>*</U><C>NT</C><NAME>Non-Medical
Package</NAME><V1>1500</V1><V2>99999999</V2><COMM>$68.93</COMM><PREM>$162.00
</PREM><TAX>$12.96</TAX></FC><FC><U>*</U><C>IT</C><NAME>Standard
Package</NAME><V1>1500</V1><V2>2000</V2><COMM>$79.99</COMM><PREM>$188.00</PR
EM><TAX>$15.04</TAX></FC><FC><U>*</U><C>CAR</C><NAME>Rental Car Physical
Damage</NAME><V1>20031010</V1><V2>20031020</V2><COMM>$58.51</COMM><PREM>$137
.50</PREM><TAX>$0.00</TAX></FC></PRODUCTS>
</QUOTE_SUMMARY>
 
[XSL - excerpt]
 <xsl:template match="PRODUCTS">
  <table border="0" width="100%" cellpadding="0">
   <tr>
    <td colspan="7"><br/></td>
   </tr>
   <tr>
    <td colspan="7"><b>Product Details</b></td>
   </tr>
   <tr>
    <td class="text" width="7%" align="center"
bgcolor="#E6F2FF"><b>Select</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Package Name</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Premium</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Tax</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Variable 1</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Variable 2</b></td>
    <td class="text" bgcolor="#E6F2FF"><b>Status</b></td>
   </tr>
  
   <xsl:for-each select="FC">
    <tr>
    <xsl:choose>
    <xsl:when test="C='CAR'">
     <td class="number" align="center"><input type="checkbox"><xsl:attribute
name="name">policy_code</xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of
select="C"/></xsl:attribute></input>
     </td>
    </xsl:when>
    <xsl:otherwise>
     <td class="number" align="center"><input type="radio"><xsl:attribute
name="name">policy_code</xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of
select="C"/></xsl:attribute></input>
     </td>
    </xsl:otherwise>
    </xsl:choose>
     <td class="number"><xsl:value-of select="NAME"/>
  <input type="hidden"><xsl:attribute name="name"><xsl:value-of
select="C"/>_policy_name</xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of
select="NAME"/></xsl:attribute></input>
     </td>
     <td class="number"><xsl:value-of select="PREM"/>
  <input type="hidden"><xsl:attribute name="name"><xsl:value-of
select="C"/>_policy_premium</xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of
select="PREM"/></xsl:attribute></input>
     </td>
     <td class="number"><xsl:value-of select="TAX"/>
  <input type="hidden"><xsl:attribute name="name"><xsl:value-of
select="C"/>_policy_tax</xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of
select="TAX"/></xsl:attribute></input>
     </td>
     <td class="number"><xsl:value-of select="V1"/>
  <input type="hidden"><xsl:attribute name="name"><xsl:value-of
select="C"/>_V1</xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of
select="V1"/></xsl:attribute></input>
     </td>
     <td class="number"><xsl:value-of select="V2"/>
  <input type="hidden"><xsl:attribute name="name"><xsl:value-of
select="C"/>_V2</xsl:attribute>
  <xsl:attribute name="value"><xsl:value-of
select="V2"/></xsl:attribute></input>
     </td>
     <td class="number"><xsl:value-of select="ERR"/>
     </td>
   
    </tr>
   </xsl:for-each>
  </table>
 </xsl:template> 

 
Thanks.
 
KC

Received on Wednesday, 17 September 2003 23:59:42 UTC