"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
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <html>
- <head>
- <title>Concessionaire Sales Liquidation</title>
- <style type="text/css">
- .ctitl {font-size:16px; font-family:Trebuchet MS; font-weight:bolder; text-align:left; background:#FFFFFF; vertical-align:top; }
- .stitl {font-size:16px; font-family:Trebuchet MS; font-weight:bolder; text-align:right; background:#FFFFFF; vertical-align:top; }
- .csubt {font-size:15px; font-family:Trebuchet MS; font-weight:bold; background:#FFFFFF; text-align:left }
- .mtitl {font-size:15px; font-family:Trebuchet MS; font-weight:900; text-align:center;vertical-align:top; }
- .date {font-size:12px; font-family:Trebuchet MS; font-weight:700; text-align:center; padding-left:5px}
- .cash {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:right; padding-right:30px; border-bottom-color:#FFFFFF}
- .credit {font-size:12px; font-family:Trebuchet MS; font-weight:500; text-align:center; padding-right:20px;}
- .scash {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:inheret; padding-right:20px; padding-left:70px}
- .dsales {font-size:15px; font-family:Trebuchet MS; font-weight:500; text-align:left; padding-right:20px;}
- .mcash {font-size:14px; font-family:Trebuchet MS; font-weight:800; text-align:right; padding-right:15px;}
- .msales {font-size:13px; font-family:Trebuchet MS; font-weight:500; text-align:right; padding-right:130px;}
- </style>
- </head>
- <body>
- <xsl:variable name="cnum" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CSMCSS"/>
- <xsl:variable name="cname" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMNAM"/>
- <xsl:variable name="cadd1" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMAD1"/>
- <xsl:variable name="cadd2" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMAD2"/>
- <xsl:variable name="cnt" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMCNT"/>
- <xsl:variable name="zip" select="METRO-CONCESSION-STATEMENT/CONCESSIONAIRE/CCMZIP"/>
- <xsl:for-each select="METRO-CONCESSION-STATEMENT/INVOICE"><!--for loop>-->
- <table width="750px" align="center" border="1" background="">
- <tr>
- <td width="750px" bgcolor="#FFFFFF" align="center">
- <table width="750px" cellpadding="1" bgcolor="#FFFFFF">
- <tr >
- <td colspan="3">
- <table width="750px" cellspacing="5" bgcolor="#FFFFFF"><!--DWLayoutTable-->
- <tr>
- <td width="1"></td>
- <td rowspan="3" width="97"> <img src="file:///C:/MetroGaisano/concessionxsl/logo.JPG" border="0"/></td>
- <td class="ctitl" >METRO GAISANO<br/>Archbishop Reyes Avenue<br/> Cebu City, PHILIPPINES 6000</td>
- <td class="stitl" >Concessionaire Sales Liquidation<br/>For the Period
- <xsl:variable name="varperd" select="CONTRACT/CSMPRD"/>
- <xsl:choose>
- <xsl:when test="$varperd=01">
- January
- </xsl:when>
- <xsl:when test="$varperd=02">
- February
- </xsl:when>
- <xsl:when test="$varperd=03">
- March
- </xsl:when>
- <xsl:when test="$varperd=04">
- April
- </xsl:when>
- <xsl:when test="$varperd=05">
- May
- </xsl:when>
- <xsl:when test="$varperd=06">
- June
- </xsl:when>
- <xsl:when test="$varperd=07">
- July
- </xsl:when>
- <xsl:when test="$varperd=08">
- August
- </xsl:when>
- <xsl:when test="$varperd=09">
- September
- </xsl:when>
- <xsl:when test="$varperd=10">
- October
- </xsl:when>
- <xsl:when test="$varperd=11">
- November
- </xsl:when>
- <xsl:when test="$varperd=12">
- December
- </xsl:when>
- </xsl:choose>
- <xsl:value-of select="CONTRACT/CSMFYR"/> <br/>
- Ref No:<xsl:value-of select="CONTRACT/CSTINV"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="3"><hr/></td>
- </tr>
- <tr>
- <td colspan="3" width="70px">
- <table width="750px" cellpadding="1">
- <tr>
- <td class="csubt">Concessionaire:<br/>
- <font size="-1" face="Trebuchet MS">
- <xsl:value-of select="$cname"/>-
- <xsl:value-of select="$cname"/><br/>
- <xsl:value-of select="$cadd1"/>
- <xsl:value-of select="$cadd2"/>
- <xsl:value-of select="$cnt"/>
- <xsl:value-of select="$zip"/>
- </font>
- </td>
- <td align="center" colspan="20"><strong> Contract # :
- <xsl:value-of select="CONTRACT/CSMCCT"/>
- <br/> <font size="-1" face="Trebuchet MS">
- <xsl:value-of select="CONTRACT/CSMLOC"/>-
- <xsl:value-of select="CONTRACT/STRNAM"/><br/>
- <xsl:value-of select="CONTRACT/CSMSDP"/>-
- <xsl:value-of select="CONTRACT/DPTNAM"/></font></strong>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="3"><hr/></td>
- </tr>
- <tr> <!--START sa 1st table sa invoice<solod>-->
- <td colspan="3" width="750px" height="20" align="center">
- <table align="center" width="750px" border="0" cellpadding="0"> <!--sa 1st table sa invoice<solod>-->
- <tr>
- </tr>
- <tr valign="top">
- <td valign="top">
- <table border="1" align="center" width="350px" height="20" > <!--sa 1st table sa invoice<solod2>-->
- <tr bgcolor="#CCCCCC" valign="top" align="center">
- <td bordercolor="#00CC66">Date</td>
- <td bordercolor="#00CC66">Cash</td>
- <td bordercolor="#00CC66">Credit</td>
- </tr>
- <xsl:for-each select="DAILY-SALES">
- <xsl:variable name="fvardate" select="CSLDAT"/>
- <xsl:if test="substring($fvardate,4,2)<=15">
- <tr>
- <td class="date">
- <xsl:variable name="vardate" select="CSLDAT"/>
- <xsl:choose>
- <xsl:when test="substring($vardate,2,2)=01">
- Jan <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=02">
- Feb <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=03">
- Mar <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=04">
- Apr <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=05">
- May <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=06">
- Jun <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=07">
- Jul <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=08">
- Aug <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=09">
- Sep <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=10">
- Oct <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=11">
- Nov <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=12">
- Dec <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- </xsl:choose>
- </td>
- <td class="cash">
- <xsl:variable name="cashamt" select="format-number(SUMCASH,' ###,###.00')"/>
- <xsl:choose>
- <xsl:when test="$cashamt!='NaN'">
- <xsl:value-of select="$cashamt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(0,' #.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td class="cash">
- <xsl:variable name="creditamt" select="format-number(SUMCREDIT,' ###,###.00')"/>
- <xsl:choose>
- <xsl:when test="$creditamt!='NaN'">
- <xsl:value-of select="$creditamt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(0,' #.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </table><!--end 1st table sa invoice<solod2>-->
- </td>
- <td>
- <table border="1" width="350px" height="20">
- <tr bgcolor="#CCCCCC" align="center">
- <td bordercolor="#00CC66">Date</td>
- <td bordercolor="#00CC66">Cash</td>
- <td bordercolor="#00CC66">Credit</td>
- </tr>
- <xsl:for-each select="DAILY-SALES">
- <xsl:variable name="fvardate" select="CSLDAT"/>
- <xsl:if test="substring($fvardate,4,2)>15">
- <tr>
- <td class="date">
- <xsl:variable name="vardate" select="CSLDAT"/>
- <xsl:choose>
- <xsl:when test="substring($vardate,2,2)=01">
- Jan <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=02">
- Feb <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=03">
- Mar <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=04">
- Apr <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=05">
- May <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=06">
- Jun <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=07">
- Jul <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=08">
- Aug <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=09">
- Sep <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=10">
- Oct <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=11">
- Nov <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- <xsl:when test="substring($vardate,2,2)=12">
- Dec <xsl:value-of select="substring($vardate,4,2)"/>
- </xsl:when>
- </xsl:choose>
- </td>
- <td class="cash">
- <xsl:variable name="cashamt" select="format-number(SUMCASH,' ###,###.00')"/>
- <xsl:choose>
- <xsl:when test="$cashamt!='NaN'">
- <xsl:value-of select="$cashamt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(0,' #.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td class="cash">
- <xsl:variable name="creditamt" select="format-number(SUMCREDIT,' ###,###.00')"/>
- <xsl:choose>
- <xsl:when test="$creditamt!='NaN'">
- <xsl:value-of select="$creditamt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(0,' #.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </table>
- </td>
- </tr>
- </table> <!--sa 1st table sa invoice<solod>-->
- </td>
- </tr> <!--END sa 1st table sa invoice<solod>-->
- <tr>
- <td colspan="3"><table width="750px">
- <tr>
- <td><!-- start of INVOICE-->
- <table width="750px">
- <tr>
- <td class="dsales" width="550px">Daily Sales Total. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="mcash" width="200px">
- <xsl:variable name="vardailysale" select="TOTAL/DAILYTOTAL"/>
- <xsl:value-of select="format-number($vardailysale,'P ###,###.00')"/>
- <!--<input type="hidden" name="dailysalestotal" value='<xsl:value-of select="$vardailysale"/>' />--> </td>
- </tr>
- <tr>
- <td class="scash">Cash Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . </td>
- <td class="msales">
- <xsl:value-of select="format-number(TOTAL/CASHTOTAL,'P ###,###.00')"/></td>
- </tr>
- <tr>
- <td class="scash">Credit Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="msales">
- <xsl:value-of select="format-number(TOTAL/CREDITTOTAL,'P ###,###.00')"/></td>
- </tr>
- <tr >
- <td class="dsales">Base Rental Fees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="mcash">
- (<xsl:variable name="varblf" select="number(CONTRACT/CCTBLF)" />
- <xsl:value-of select="format-number($varblf,'P ###,###.00')"/>)
- </td>
- </tr>
- <tr>
- <td class="dsales">Commission Chargeable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . </td>
- <td class="mcash">
- <xsl:variable name="varcomtemp" select="CONTRACT/CSTAMT"/>
- <xsl:variable name="varcomchar" select="$varcomtemp"/>
- <xsl:choose>
- <xsl:when test="string(number($varcomtemp))!='NaN'">
- (<xsl:value-of select="format-number($varcomchar,'P ###,###.00')"/>)
- </xsl:when>
- <xsl:otherwise>
- (<xsl:value-of select="format-number(0,'P ###,###.00')"/>)
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <tr>
- <td class="scash">Percentage Commission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . </td>
- <td class="msales">
- <xsl:variable name="varperce" select="(PERCOM/CMTCTP)*.01"/>
- <xsl:variable name="percecom" select="$vardailysale * $varperce"/>
- <xsl:value-of select="format-number($vardailysale * $varperce,'P ###,###.00')"/></td>
- </tr>
- <tr>
- <td class="scash">Minimum Commission. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="msales">
- <xsl:if test="string(format-number($percecom,'###.00'))!=string(format-number($varcomchar,'###.00'))">
- </xsl:if>
- <xsl:choose>
- <xsl:when test="string(format-number($percecom,'###.00'))!=string(format-number($varcomchar,'###.00'))">
- <xsl:choose>
- <xsl:when test="string(number($varcomtemp))!='NaN'">
- <xsl:value-of select="format-number($varcomchar,'P ###,###.00')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(0,'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="varmincom" select="CONTRACT/CCTMSG"/>
- <xsl:value-of select="format-number(CONTRACT/CCTMSG,'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <tr>
- <td class="dsales">Miscellaneous Charges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="mcash">
- <xsl:variable name="varsumcmcamt" select="sum(MISC-CHARGEABLE/CMCAMT)"/>
- <xsl:choose>
- <xsl:when test="string(number($varsumcmcamt))!='NaN'">
- <xsl:variable name="varsumcmcamt2" select="$varsumcmcamt"/>
- (<xsl:value-of select="format-number($varsumcmcamt2,'P ###,###.00')"/>)
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="varsumcmcamt2" select="number('0')"/>
- <xsl:value-of select="format-number($varsumcmcamt2,'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <xsl:for-each select="MISC-CHARGEABLE">
- <xsl:variable name="misc" select="CMCMIS"/>
- <tr>
- <td class="scash">
- <xsl:value-of select="CMCMIS"/>-<xsl:value-of select="CMSDSC"/>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- </td>
- <td class="msales">
- <xsl:variable name="varcmcmat" select="CMCAMT"/>
- <xsl:choose>
- <xsl:when test="string(number($varcmcmat))!='NaN'">
- <xsl:value-of select="format-number($varcmcmat,'P ###,###.00')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(number('0'),'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- <table border="0" width="100%">
- <tr>
- <td class="dsales">SUB-TOTAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="mcash">
- <xsl:variable name="dailysalestotal" select="DAILY-TOTAL/DAILY-SALES-TOTAL"/><br />
- <xsl:choose>
- <xsl:when test="string(number($varsumcmcamt))!='NaN'">
- <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $varcomchar - $ varsumcmcamt"/>
- <xsl:value-of select="format-number($varsubtotal'P ###,###.00')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $ varsumcmcamt"/>
- <xsl:value-of select="format-number($varsubtotal'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <!--template to get the subtotal-->
- <xsl:variable name="varcmcmis" select="OTHER-CHARGES/CMCMIS"/>
- <xsl:variable name="varcmsdsc" select="OTHER-CHARGES/CMSDSC"/>
- <xsl:variable name="varcmcamt" select="OTHER-CHARGES/CMCAMT"/>
- <xsl:if test="format-number($varcmcamt,'P ###,###.00')!='NaN'">
- <tr>
- <td class="dsales">OTHER CHARGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</td>
- <td class="mcash">
- <xsl:value-of select="format-number($varcmcamt,'P ###,###.00')"/>
- </td>
- </tr>
- <tr>
- <td class="scash">
- <xsl:value-of select="$varcmcmis"/>-<xsl:value-of select="$varcmsdsc"/> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- </td>
- <td class="msales">
- <xsl:choose>
- <xsl:when test="string(number(OTHER-CHARGES/CMCAMT))!='NaN'">
- <xsl:value-of select="format-number($varcmcamt,'P ###,###.00')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number(number('0'),'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:if>
- </table><br /><hr />
- <table width="100%">
- <tr>
- <td class="dsales">NET AMOUNT PAYABLE TO CONCESSIONAIRE- - - - - - - - - - - - - - - - - - - - - - - - - - - - -</td>
- <td class="mcash">
- <xsl:choose>
- <xsl:when test="string(number($varsumcmcamt))!='NaN'">
- <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $varcomchar - $ varsumcmcamt"/>
- <xsl:choose>
- <xsl:when test="format-number($varcmcamt,'P ###,###.00')!='NaN'">
- <xsl:value-of select="format-number($varsubtotal - $varcmcamt,'P ###,###.00')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number($varsubtotal,'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="varsubtotal" select="$vardailysale - $varblf - $ varsumcmcamt"/>
- <xsl:value-of select="format-number($varsubtotal,'P ###,###.00')"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table><br/><!-- end for INVOICE table-->
- </td><!-- end for INVOICE -->
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><br/></td>
- </tr>
- </table>
- </td></tr>
- </table>
- <br/>
- <br/>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="loop">
- <xsl:param name="var"/>
- <xsl:choose>
- <xsl:when test="$var < 12">
- <tr>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- <td height="35"><br/></td>
- </tr>
- <xsl:call-template name="loop">
- <xsl:with-param name="var">
- <xsl:number value="number($var)+1" />
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>