By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,246 Members | 1,515 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,246 IT Pros & Developers. It's quick & easy.

Error loading Stylesheet:Xpath parse Failure

P: 2
Im currently working on this xml file but when i load it to Mozilla, i got an error
"Error Loading Stylesheet: Xpath parse failure: invalid variable name"
It loads on IE properly. Only with the mozilla browser i get an error.
Would someone help me pls.

Here is the code:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"  encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="html" omit-xml-declaration="yes"/>
  4. <xsl:template match="/">
  5. <html>
  6. <head>
  7. <title>Concessionaire Sales Liquidation</title>
  8. <style type="text/css">
  9.       .ctitl {font-size:16px; font-family:Trebuchet MS; font-weight:bolder; text-align:left; background:#FFFFFF; vertical-align:top; }
  10.     .stitl {font-size:16px; font-family:Trebuchet MS; font-weight:bolder; text-align:right; background:#FFFFFF; vertical-align:top; }
  11.       .csubt {font-size:15px; font-family:Trebuchet MS; font-weight:bold; background:#FFFFFF; text-align:left }
  12.       .mtitl {font-size:15px; font-family:Trebuchet MS; font-weight:900; text-align:center;vertical-align:top;  }
  13.       .date {font-size:12px; font-family:Trebuchet MS; font-weight:700; text-align:center; padding-left:5px}
  14.     .cash {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:right; padding-right:30px; border-bottom-color:#FFFFFF}
  15.     .credit {font-size:12px; font-family:Trebuchet MS; font-weight:500; text-align:center; padding-right:20px;}
  16.     .scash {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:inheret; padding-right:20px; padding-left:70px}
  17.     .dsales {font-size:15px; font-family:Trebuchet MS; font-weight:500; text-align:left; padding-right:20px;}
  18.     .mcash {font-size:14px; font-family:Trebuchet MS; font-weight:800; text-align:right; padding-right:15px;}
  19.     .msales {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:right; padding-right:130px;}
  20.  
  21. </style>
  22. </head>
  23. <body>
  24.  
  25. <xsl:variable name="cnum" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CSMCSS"/>
  26. <xsl:variable name="cname" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMNAM"/>
  27. <xsl:variable name="cadd1" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMAD1"/>
  28. <xsl:variable name="cadd2" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMAD2"/>
  29. <xsl:variable name="cnt" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMCNT"/>
  30. <xsl:variable name="zip" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMZIP"/>
  31.  
  32. <xsl:for-each select="METRO-CONCESSION-STATEMENT/INVOICE"><!--for loop>-->
  33.  
  34. <table width="750px" align="center" border="1" background="">
  35.     <tr>
  36.         <td width="750px" bgcolor="#FFFFFF" align="center">
  37.             <table width="750px" cellpadding="1" bgcolor="#FFFFFF">
  38.                 <tr >
  39.                     <td colspan="3">
  40.                         <table width="750px" cellspacing="5" bgcolor="#FFFFFF"><!--DWLayoutTable-->
  41.                             <tr>
  42.                                 <td width="1"></td> 
  43.                                 <td rowspan="3" width="97">    <img src="file:///C:/MetroGaisano/concessionxsl/logo.JPG" border="0"/></td>
  44.                                 <td class="ctitl" >METRO GAISANO<br/>Archbishop Reyes Avenue<br/> Cebu City, PHILIPPINES 6000</td>
  45.                                 <td class="stitl" >Concessionaire Sales Liquidation<br/>For the Period
  46.                                  <xsl:variable name="varperd" select="CONTRACT/CSMPRD"/>
  47.                                       <xsl:choose>
  48.                                         <xsl:when test="$varperd=01">
  49.                                             January
  50.                                         </xsl:when>
  51.                                         <xsl:when test="$varperd=02">
  52.                                             February
  53.                                         </xsl:when>
  54.                                         <xsl:when test="$varperd=03">
  55.                                             March
  56.                                         </xsl:when>
  57.                                         <xsl:when test="$varperd=04">
  58.                                             April
  59.                                         </xsl:when>
  60.                                         <xsl:when test="$varperd=05"> 
  61.                                             May
  62.                                         </xsl:when>
  63.                                         <xsl:when test="$varperd=06">
  64.                                             June
  65.                                         </xsl:when>
  66.                                         <xsl:when test="$varperd=07"> 
  67.                                             July
  68.                                         </xsl:when>
  69.                                         <xsl:when test="$varperd=08">
  70.                                             August
  71.                                         </xsl:when>
  72.                                         <xsl:when test="$varperd=09">
  73.                                             September
  74.                                         </xsl:when>
  75.                                         <xsl:when test="$varperd=10">
  76.                                             October
  77.                                         </xsl:when>
  78.                                         <xsl:when test="$varperd=11">
  79.                                             November
  80.                                         </xsl:when>
  81.                                         <xsl:when test="$varperd=12">
  82.                                             December
  83.                                         </xsl:when>
  84.                                     </xsl:choose>
  85.                                 <xsl:value-of select="CONTRACT/CSMFYR"/> <br/>
  86.                                 Ref No:<xsl:value-of select="CONTRACT/CSTINV"/>
  87.                                 </td>
  88.                             </tr>
  89.                         </table>
  90.                     </td>
  91.                 </tr>
  92.                  <tr> 
  93.                   <td colspan="3"><hr/></td>
  94.                 </tr>
  95.                 <tr> 
  96.                     <td colspan="3" width="70px">
  97.                         <table width="750px" cellpadding="1">
  98.                         <tr> 
  99.                             <td class="csubt">Concessionaire:<br/>
  100.                                <font size="-1" face="Trebuchet MS">
  101.                                <xsl:value-of select="$cname"/>- 
  102.                                <xsl:value-of select="$cname"/><br/>
  103.  
  104.                                <xsl:value-of select="$cadd1"/>
  105.                                <xsl:value-of select="$cadd2"/>
  106.                                <xsl:value-of select="$cnt"/>
  107.                                <xsl:value-of select="$zip"/>
  108.                                 </font>
  109.                             </td>
  110.                             <td align="center" colspan="20"><strong>    Contract # :
  111.                                 <xsl:value-of select="CONTRACT/CSMCCT"/>
  112.                                 <br/> <font size="-1" face="Trebuchet MS"> 
  113.  
  114.                                 <xsl:value-of select="CONTRACT/CSMLOC"/>-
  115.                                 <xsl:value-of select="CONTRACT/STRNAM"/><br/>
  116.  
  117.                                 <xsl:value-of select="CONTRACT/CSMSDP"/>-
  118.                                 <xsl:value-of select="CONTRACT/DPTNAM"/></font></strong>
  119.                             </td>
  120.                            </tr>
  121.                         </table>
  122.  
  123.                 </td>
  124.             </tr>
  125.             <tr> 
  126.               <td colspan="3"><hr/></td>
  127.             </tr>
  128.  
  129.  
  130.     <tr> <!--START sa 1st table sa invoice<solod>-->
  131.         <td colspan="3" width="750px" height="20" align="center">
  132.             <table align="center" width="750px" border="0" cellpadding="0">  <!--sa 1st table sa invoice<solod>-->
  133.                 <tr>
  134.                 </tr>
  135.                 <tr valign="top">
  136.                     <td valign="top">
  137.                           <table border="1" align="center" width="350px" height="20" > <!--sa 1st table sa invoice<solod2>-->
  138.                             <tr  bgcolor="#CCCCCC" valign="top" align="center">
  139.                                 <td bordercolor="#00CC66">Date</td>
  140.                                 <td bordercolor="#00CC66">Cash</td>
  141.                                 <td bordercolor="#00CC66">Credit</td>
  142.                             </tr>
  143.                             <xsl:for-each select="DAILY-SALES">
  144.                             <xsl:variable name="fvardate" select="CSLDAT"/>
  145.                             <xsl:if test="substring($fvardate,4,2)&lt;=15">
  146.                             <tr>
  147.                                  <td class="date">
  148.                                 <xsl:variable name="vardate" select="CSLDAT"/>
  149.                                  <xsl:choose>
  150.                                     <xsl:when test="substring($vardate,2,2)=01">
  151.                                         Jan <xsl:value-of select="substring($vardate,4,2)"/>
  152.                                     </xsl:when>
  153.                                     <xsl:when test="substring($vardate,2,2)=02">
  154.                                         Feb <xsl:value-of select="substring($vardate,4,2)"/>
  155.                                     </xsl:when>
  156.                                     <xsl:when test="substring($vardate,2,2)=03">
  157.                                         Mar <xsl:value-of select="substring($vardate,4,2)"/>
  158.                                     </xsl:when>
  159.                                     <xsl:when test="substring($vardate,2,2)=04">
  160.                                         Apr <xsl:value-of select="substring($vardate,4,2)"/>
  161.                                     </xsl:when>
  162.                                     <xsl:when test="substring($vardate,2,2)=05"> 
  163.                                         May <xsl:value-of select="substring($vardate,4,2)"/>
  164.                                     </xsl:when>
  165.                                     <xsl:when test="substring($vardate,2,2)=06">
  166.                                         Jun <xsl:value-of select="substring($vardate,4,2)"/>
  167.                                     </xsl:when>
  168.                                     <xsl:when test="substring($vardate,2,2)=07"> 
  169.                                         Jul <xsl:value-of select="substring($vardate,4,2)"/>
  170.                                     </xsl:when>
  171.                                     <xsl:when test="substring($vardate,2,2)=08">
  172.                                         Aug <xsl:value-of select="substring($vardate,4,2)"/>
  173.                                     </xsl:when>
  174.                                     <xsl:when test="substring($vardate,2,2)=09">
  175.                                         Sep <xsl:value-of select="substring($vardate,4,2)"/>
  176.                                     </xsl:when>
  177.                                     <xsl:when test="substring($vardate,2,2)=10">
  178.                                         Oct <xsl:value-of select="substring($vardate,4,2)"/>
  179.                                     </xsl:when>
  180.                                     <xsl:when test="substring($vardate,2,2)=11">
  181.                                         Nov <xsl:value-of select="substring($vardate,4,2)"/>
  182.                                     </xsl:when>
  183.                                     <xsl:when test="substring($vardate,2,2)=12">
  184.                                         Dec <xsl:value-of select="substring($vardate,4,2)"/>
  185.                                     </xsl:when>
  186.                                 </xsl:choose>
  187.                                 </td>
  188.                                 <td class="cash">
  189.                                     <xsl:variable name="cashamt" select="format-number(SUMCASH,' ###,###.00')"/>
  190.                                         <xsl:choose>
  191.                                             <xsl:when test="$cashamt!='NaN'">
  192.                                                 <xsl:value-of select="$cashamt"/>
  193.                                             </xsl:when>
  194.                                             <xsl:otherwise>
  195.                                                 <xsl:value-of select="format-number(0,' #.00')"/>
  196.                                             </xsl:otherwise>
  197.                                         </xsl:choose>
  198.                                 </td>
  199.                                 <td class="cash">
  200.                                  <xsl:variable name="creditamt" select="format-number(SUMCREDIT,' ###,###.00')"/>
  201.                                     <xsl:choose>
  202.                                         <xsl:when test="$creditamt!='NaN'">
  203.                                             <xsl:value-of select="$creditamt"/>
  204.                                         </xsl:when>
  205.                                         <xsl:otherwise>
  206.                                             <xsl:value-of select="format-number(0,' #.00')"/>
  207.                                         </xsl:otherwise>
  208.                                     </xsl:choose>
  209.                                 </td>
  210.                             </tr>
  211.                             </xsl:if>
  212.                             </xsl:for-each>
  213.                         </table><!--end 1st table sa invoice<solod2>-->
  214.                     </td>
  215.                     <td>
  216.                         <table border="1"  width="350px" height="20">
  217.                             <tr  bgcolor="#CCCCCC" align="center">
  218.                                 <td bordercolor="#00CC66">Date</td>
  219.                                 <td bordercolor="#00CC66">Cash</td>
  220.                                 <td bordercolor="#00CC66">Credit</td>
  221.                             </tr>
  222.                             <xsl:for-each select="DAILY-SALES">
  223.                             <xsl:variable name="fvardate" select="CSLDAT"/>
  224.                             <xsl:if test="substring($fvardate,4,2)&gt;15">
  225.                             <tr>
  226.                                  <td class="date">
  227.                                 <xsl:variable name="vardate" select="CSLDAT"/>
  228.                                  <xsl:choose>
  229.                                     <xsl:when test="substring($vardate,2,2)=01">
  230.                                         Jan <xsl:value-of select="substring($vardate,4,2)"/>
  231.                                     </xsl:when>
  232.                                     <xsl:when test="substring($vardate,2,2)=02">
  233.                                         Feb <xsl:value-of select="substring($vardate,4,2)"/>
  234.                                     </xsl:when>
  235.                                     <xsl:when test="substring($vardate,2,2)=03">
  236.                                         Mar <xsl:value-of select="substring($vardate,4,2)"/>
  237.                                     </xsl:when>
  238.                                     <xsl:when test="substring($vardate,2,2)=04">
  239.                                         Apr <xsl:value-of select="substring($vardate,4,2)"/>
  240.                                     </xsl:when>
  241.                                     <xsl:when test="substring($vardate,2,2)=05"> 
  242.                                         May <xsl:value-of select="substring($vardate,4,2)"/>
  243.                                     </xsl:when>
  244.                                     <xsl:when test="substring($vardate,2,2)=06">
  245.                                         Jun <xsl:value-of select="substring($vardate,4,2)"/>
  246.                                     </xsl:when>
  247.                                     <xsl:when test="substring($vardate,2,2)=07"> 
  248.                                         Jul <xsl:value-of select="substring($vardate,4,2)"/>
  249.                                     </xsl:when>
  250.                                     <xsl:when test="substring($vardate,2,2)=08">
  251.                                         Aug <xsl:value-of select="substring($vardate,4,2)"/>
  252.                                     </xsl:when>
  253.                                     <xsl:when test="substring($vardate,2,2)=09">
  254.                                         Sep <xsl:value-of select="substring($vardate,4,2)"/>
  255.                                     </xsl:when>
  256.                                     <xsl:when test="substring($vardate,2,2)=10">
  257.                                         Oct <xsl:value-of select="substring($vardate,4,2)"/>
  258.                                     </xsl:when>
  259.                                     <xsl:when test="substring($vardate,2,2)=11">
  260.                                         Nov <xsl:value-of select="substring($vardate,4,2)"/>
  261.                                     </xsl:when>
  262.                                     <xsl:when test="substring($vardate,2,2)=12">
  263.                                         Dec <xsl:value-of select="substring($vardate,4,2)"/>
  264.                                     </xsl:when>
  265.                                 </xsl:choose>
  266.                                 </td>
  267.                                 <td class="cash">
  268.                                     <xsl:variable name="cashamt" select="format-number(SUMCASH,' ###,###.00')"/>
  269.                                         <xsl:choose>
  270.                                             <xsl:when test="$cashamt!='NaN'">
  271.                                                 <xsl:value-of select="$cashamt"/>
  272.                                             </xsl:when>
  273.                                             <xsl:otherwise>
  274.                                                 <xsl:value-of select="format-number(0,' #.00')"/>
  275.                                             </xsl:otherwise>
  276.                                         </xsl:choose>
  277.                                 </td>
  278.                                 <td class="cash">
  279.                                  <xsl:variable name="creditamt" select="format-number(SUMCREDIT,' ###,###.00')"/>
  280.                                     <xsl:choose>
  281.                                         <xsl:when test="$creditamt!='NaN'">
  282.                                             <xsl:value-of select="$creditamt"/>
  283.                                         </xsl:when>
  284.                                         <xsl:otherwise>
  285.                                             <xsl:value-of select="format-number(0,' #.00')"/>
  286.                                         </xsl:otherwise>
  287.                                     </xsl:choose>
  288.                                 </td>
  289.                             </tr>
  290.                             </xsl:if>
  291.                             </xsl:for-each>
  292.                         </table>
  293.                     </td>
  294.                 </tr>                
  295.             </table> <!--sa 1st table sa invoice<solod>-->
  296.         </td>
  297.     </tr>  <!--END sa 1st table sa invoice<solod>-->
  298.  
  299.     <tr> 
  300.         <td colspan="3"><table width="750px">
  301.              <tr>
  302.                 <td><!-- start of INVOICE-->
  303.                     <table width="750px">
  304.                         <tr>
  305.                             <td class="dsales" width="550px">Daily Sales Total. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . .</td>
  306.                             <td class="mcash" width="200px">
  307.                                 <xsl:variable name="vardailysale" select="TOTAL/DAILYTOTAL"/>
  308.                                 <xsl:value-of select="format-number($vardailysale,'P ###,###.00')"/>
  309.                                 <!--<input type="hidden" name="dailysalestotal" value='<xsl:value-of select="$vardailysale"/>' />-->                                                                                         </td>
  310.                         </tr>  
  311.                         <tr>
  312.                             <td class="scash">Cash Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . </td>
  313.                             <td  class="msales">
  314.                             <xsl:value-of select="format-number(TOTAL/CASHTOTAL,'P ###,###.00')"/></td>
  315.                         </tr>
  316.                         <tr>
  317.                             <td class="scash">Credit Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  318.                             <td class="msales">
  319.                             <xsl:value-of select="format-number(TOTAL/CREDITTOTAL,'P ###,###.00')"/></td>
  320.                         </tr>
  321.                         <tr >
  322.                             <td class="dsales">Base Rental Fees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  323.                             <td class="mcash">
  324.                                 (<xsl:variable name="varblf" select="number(CONTRACT/CCTBLF)" />
  325.                                 <xsl:value-of select="format-number($varblf,'P ###,###.00')"/>)
  326.                             </td>
  327.                         </tr>
  328.                         <tr>
  329.                             <td class="dsales">Commission Chargeable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . </td>
  330.                             <td class="mcash">
  331.                                 <xsl:variable name="varcomtemp" select="CONTRACT/CSTAMT"/>
  332.                                 <xsl:variable name="varcomchar" select="$varcomtemp"/>
  333.                                 <xsl:choose>
  334.                                     <xsl:when test="string(number($varcomtemp))!='NaN'">
  335.                                     (<xsl:value-of select="format-number($varcomchar,'P ###,###.00')"/>)
  336.                                     </xsl:when>
  337.                                     <xsl:otherwise>
  338.                                     (<xsl:value-of select="format-number(0,'P ###,###.00')"/>)
  339.                                     </xsl:otherwise>
  340.                                 </xsl:choose>                                
  341.                             </td>
  342.                         </tr>
  343.                         <tr>
  344.                             <td class="scash">Percentage Commission . . . . . . .  .  . . . . . . . . . . . . . . . . . . . . . . . . . </td>
  345.                             <td class="msales">
  346.                                 <xsl:variable name="varperce" select="(PERCOM/CMTCTP)*.01"/>
  347.                                 <xsl:variable name="percecom" select="$vardailysale * $varperce"/>
  348.                                 <xsl:value-of select="format-number($vardailysale * $varperce,'P ###,###.00')"/></td>
  349.                         </tr>
  350.                         <tr>
  351.                             <td class="scash">Minimum Commission. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  352.                             <td class="msales">
  353.                                 <xsl:if test="string(format-number($percecom,'###.00'))!=string(format-number($varcomchar,'###.00'))">
  354.                                 </xsl:if>
  355.  
  356.                                 <xsl:choose>
  357.                                     <xsl:when test="string(format-number($percecom,'###.00'))!=string(format-number($varcomchar,'###.00'))">
  358.                                         <xsl:choose>
  359.                                     <xsl:when test="string(number($varcomtemp))!='NaN'">
  360.                                         <xsl:value-of select="format-number($varcomchar,'P ###,###.00')"/>
  361.                                     </xsl:when>
  362.                                     <xsl:otherwise>
  363.                                         <xsl:value-of select="format-number(0,'P ###,###.00')"/>
  364.                                     </xsl:otherwise>
  365.                                 </xsl:choose>            
  366.                                     </xsl:when>
  367.                                     <xsl:otherwise>
  368.                                         <xsl:variable name="varmincom" select="CONTRACT/CCTMSG"/>
  369.                                         <xsl:value-of select="format-number(CONTRACT/CCTMSG,'P ###,###.00')"/>
  370.                                     </xsl:otherwise>
  371.                                 </xsl:choose>
  372.                             </td>
  373.                         </tr>
  374.                         <tr>
  375.                             <td class="dsales">Miscellaneous Charges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  376.                             <td class="mcash">
  377.                             <xsl:variable name="varsumcmcamt" select="sum(MISC-CHARGEABLE/CMCAMT)"/>
  378.                             <xsl:choose>
  379.                                 <xsl:when test="string(number($varsumcmcamt))!='NaN'">
  380.                                     <xsl:variable name="varsumcmcamt2" select="$varsumcmcamt"/>
  381.                                     (<xsl:value-of select="format-number($varsumcmcamt2,'P ###,###.00')"/>)
  382.                                 </xsl:when>
  383.                                 <xsl:otherwise>
  384.                                     <xsl:variable name="varsumcmcamt2" select="number('0')"/>
  385.                                     <xsl:value-of select="format-number($varsumcmcamt2,'P ###,###.00')"/>
  386.                                 </xsl:otherwise>
  387.                             </xsl:choose>        
  388.                             </td>
  389.                         </tr>
  390.                         <xsl:for-each select="MISC-CHARGEABLE">
  391.                         <xsl:variable name="misc" select="CMCMIS"/>
  392.                         <tr>
  393.                             <td class="scash">
  394.                                 <xsl:value-of select="CMCMIS"/>-<xsl:value-of select="CMSDSC"/>. . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . .  . . . . . 
  395.                             </td>
  396.                             <td class="msales">
  397.                             <xsl:variable name="varcmcmat" select="CMCAMT"/>
  398.                                 <xsl:choose>
  399.                                     <xsl:when test="string(number($varcmcmat))!='NaN'">
  400.                                         <xsl:value-of select="format-number($varcmcmat,'P ###,###.00')"/>
  401.                                     </xsl:when>
  402.                                     <xsl:otherwise>
  403.                                         <xsl:value-of select="format-number(number('0'),'P ###,###.00')"/>
  404.                                     </xsl:otherwise>
  405.                                 </xsl:choose>
  406.                             </td>
  407.                         </tr>                                    
  408.                         </xsl:for-each>
  409.                     </table>
  410.                     <table border="0" width="100%">
  411.                         <tr>
  412.                             <td class="dsales">SUB-TOTAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  413.                             <td class="mcash">
  414.                                 <xsl:variable name="dailysalestotal" select="DAILY-TOTAL/DAILY-SALES-TOTAL"/><br />
  415.                                     <xsl:choose>
  416.                                         <xsl:when test="string(number($varsumcmcamt))!='NaN'">                                    
  417.                                             <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $varcomchar - $ varsumcmcamt"/>
  418.                                             <xsl:value-of select="format-number($varsubtotal'P ###,###.00')"/>
  419.                                         </xsl:when>
  420.                                         <xsl:otherwise>
  421.                                             <xsl:variable name="varsubtotal" select="$vardailysale - $varblf  - $ varsumcmcamt"/>
  422.                                             <xsl:value-of select="format-number($varsubtotal'P ###,###.00')"/>
  423.                                         </xsl:otherwise>
  424.                                         </xsl:choose>        
  425.                             </td>
  426.                         </tr>
  427.                             <!--template to get the subtotal-->
  428.                             <xsl:variable name="varcmcmis" select="OTHER-CHARGES/CMCMIS"/>
  429.                             <xsl:variable name="varcmsdsc" select="OTHER-CHARGES/CMSDSC"/>
  430.                             <xsl:variable name="varcmcamt" select="OTHER-CHARGES/CMCAMT"/>
  431.                             <xsl:if test="format-number($varcmcamt,'P ###,###.00')!='NaN'">
  432.                         <tr>
  433.                             <td class="dsales">OTHER CHARGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
  434.                             <td class="mcash">
  435.                                 <xsl:value-of select="format-number($varcmcamt,'P ###,###.00')"/>
  436.                             </td>
  437.                         </tr>
  438.                         <tr>
  439.                             <td class="scash">
  440.                                 <xsl:value-of select="$varcmcmis"/>-<xsl:value-of select="$varcmsdsc"/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
  441.                             </td>
  442.                             <td class="msales">
  443.                              <xsl:choose>
  444.                                     <xsl:when test="string(number(OTHER-CHARGES/CMCAMT))!='NaN'">
  445.                                         <xsl:value-of select="format-number($varcmcamt,'P ###,###.00')"/>
  446.                                     </xsl:when>
  447.                                     <xsl:otherwise>
  448.                                         <xsl:value-of select="format-number(number('0'),'P ###,###.00')"/>
  449.                                     </xsl:otherwise>
  450.                                 </xsl:choose>    
  451.                             </td>
  452.                         </tr>
  453.                         </xsl:if>
  454.                     </table><br /><hr />
  455.                   <table width="100%">
  456.                         <tr>
  457.                             <td class="dsales">NET AMOUNT PAYABLE TO CONCESSIONAIRE- - - - - - - - - - - - - - - - - - - - - - - - - -  - - -</td>
  458.                             <td class="mcash">
  459.                                 <xsl:choose>
  460.                                     <xsl:when test="string(number($varsumcmcamt))!='NaN'">                                    
  461.                                         <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $varcomchar - $ varsumcmcamt"/>
  462.                                         <xsl:choose>
  463.                                             <xsl:when test="format-number($varcmcamt,'P ###,###.00')!='NaN'">
  464.                                                 <xsl:value-of select="format-number($varsubtotal - $varcmcamt,'P ###,###.00')"/>
  465.                                             </xsl:when>
  466.                                             <xsl:otherwise>
  467.                                                 <xsl:value-of select="format-number($varsubtotal,'P ###,###.00')"/>
  468.                                             </xsl:otherwise>
  469.                                         </xsl:choose>
  470.                                     </xsl:when>
  471.                                     <xsl:otherwise>
  472.                                         <xsl:variable name="varsubtotal" select="$vardailysale - $varblf  - $ varsumcmcamt"/>
  473.                                         <xsl:value-of select="format-number($varsubtotal,'P ###,###.00')"/>
  474.                                     </xsl:otherwise>
  475.                                 </xsl:choose>
  476.                             </td>
  477.                         </tr>
  478.                     </table><br/><!-- end for INVOICE table-->
  479.                 </td><!-- end for INVOICE -->
  480.             </tr>
  481.         </table>
  482.     </td>
  483.  
  484.     </tr>
  485.  
  486.     <tr> 
  487.           <td><br/></td>
  488.     </tr>
  489.     </table>
  490.     </td></tr>
  491. </table>
  492. <br/>
  493. <br/>
  494. </xsl:for-each>
  495. </body>
  496. </html>
  497.  
  498. </xsl:template>
  499. <xsl:template name="loop">
  500.     <xsl:param name="var"/>
  501.                 <xsl:choose>
  502.                   <xsl:when test="$var &lt; 12">
  503.                     <tr>
  504.                       <td height="35"><br/></td>
  505.                       <td height="35"><br/></td>
  506.                       <td height="35"><br/></td>
  507.                       <td height="35"><br/></td>
  508.                       <td height="35"><br/></td>
  509.                       <td height="35"><br/></td>
  510.                       <td height="35"><br/></td>
  511.                       <td height="35"><br/></td>
  512.                       </tr>
  513.                     <xsl:call-template name="loop">
  514.                       <xsl:with-param name="var">
  515.                         <xsl:number value="number($var)+1" />
  516.                       </xsl:with-param>
  517.                     </xsl:call-template>
  518.                   </xsl:when>
  519.                   <xsl:otherwise>
  520.  
  521.                   </xsl:otherwise>
  522.                 </xsl:choose>
  523.               </xsl:template>
  524. </xsl:stylesheet>
  525.  
Oct 15 '08 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
you could comment out the variables and uncomment them one by one, so you will find the one(s) that cause the error.

PS: please use [code] tags when posting code
Oct 15 '08 #2

jkmyoung
Expert 100+
P: 2,057
My guess is an out of scope variable but it's hard to tell. If you gave a sample of source xml, we might be able to tell. Also, a side xsl recommendation. Use a xml structure to retrieve the months:

Expand|Select|Wrap|Line Numbers
  1. <my:mapping xmlns:my="internal">
  2.     <month shortName="Jan" value="01"/>
  3.     <month shortName="Feb" value="02"/>
  4.     <month shortName="Mar" value="03"/>
  5.     <month shortName="Apr" value="04"/>
  6.     <month shortName="May" value="05"/>
  7.     <month shortName="Jun" value="06"/>
  8.     <month shortName="Jul" value="07"/>
  9.     <month shortName="Aug" value="08"/>
  10.     <month shortName="Sep" value="09"/>
  11.     <month shortName="Oct" value="10"/>
  12.     <month shortName="Nov" value="11"/>
  13.     <month shortName="Dec" value="12"/>        
  14. </my:mapping>
  15.  
  16. -- To retrieve the value do the following:
  17. Instead of the really long choose:
  18. <xsl:when test="substring($vardate,2,2)='01"> etc....
  19. USE:
  20.  
  21. <xsl:value-of select="document('')//month[@value = substring($vardate,2,2)]/@shortName"/>
  22.  
Much more manageable code this way. Place the xml structure anywhere in the xslt, eg, at the end before the final </xsl:stylesheet> node.
Oct 15 '08 #3

P: 2
you could comment out the variables and uncomment them one by one, so you will find the one(s) that cause the error.

PS: please use [code] tags when posting code
I followed your advice, I uncomment every variable and i found ones that duplicate. Mozilla doesnt support it.. and Wopeyyy! i fixed it...its ok now. Thanks for the advice.
Keep on helping other people. Thanks again.

And owh:-( im sorry about the [code] tags..i didnt know that it was there, Its my first time to post in this forum.. I will use it next time.
Oct 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.