PDA

View Full Version : Error during XSLT transformation: (null). But only in none IE browsers


MRMAN
06-14-2006, 03:49 PM
hello

In IE the code below appears to work fine. The javascript at the top pulls the url query string and find the relivent number. This number is then used so load the relivent css file.

It works find in IE. all the javascript works and everything is grand. but in Mozilla i get the error "Error during XSLT transformation: (null)." i have looked on google to try and find the error but i find little useful information.

Do you have any ideas what might be the problem

Cheers

MM


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<meta http-equiv="EXPIRES" content="0"/>
<script language="javascript" type="text/javascript">
<![CDATA[
test = location.search;
test2 = test.substring(1);
var temp = new Array();
temp = test2.split("&");
var i = 0;
var affidend = 0;
for(x in temp)
{
fonzie = temp[x]
start = new Array()
start = fonzie.split("=")

if(start[0] == 'affid')
{

document.write('<link rel="stylesheet" type="text/css" href="'+start[1]+'/style.css" />')
affidend = start[1]
}
}
]]>
</script>
</head>
<body>
<script language="javascript" type="text/javascript">
document.write('<xsl:variable name="affid">'+affidend+'</xsl:variable>')

function makebanner(selid, affid, price)
{
document.location.href="http://ff.connextra.com/Betfred/selector/click?client=Betfred&amp;placement=testtext1x1&amp;selid="+selid+"&amp;price="+price+"&amp;fimsid=151&amp;AffiliateId=0&amp;tclk=http://affiliate.connextra.com/e.asp?e=129&amp;id="+affid+"&amp;sub=default&amp;p=";
}

</script>
<img src="http://ff.connextra.com/Betfred/selector/image?client=Betfred&amp;placement=testtext1x1" border="0" width="1" height="1"/>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="title" width="100%">International Football</td>
</tr>
<xsl:for-each select="category/event">
<tr>
<td> </td>
</tr>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<xsl:for-each select="bettype">
<tr>
<td class="eventtitle" colspan="2">
<xsl:variable name="alf" select="@bet-start-date"/>
<xsl:if test="$alf != ''">
<xsl:variable name="year" select="substring(@bet-start-date,0,5)"/>
<xsl:variable name="month" select="substring(@bet-start-date,5,2)"/>
<xsl:variable name="day" select="substring(@bet-start-date,7,2)"/>
<xsl:value-of select="$year"/> 
<xsl:value-of select="$day"/> 
<xsl:if test="$month = '01'">Jan</xsl:if>
<xsl:if test="$month = '02'">Feb</xsl:if>
<xsl:if test="$month = '03'">Mar</xsl:if>
<xsl:if test="$month = '04'">Apr</xsl:if>
<xsl:if test="$month = '05'">May</xsl:if>
<xsl:if test="$month = '06'">Jun</xsl:if>
<xsl:if test="$month = '07'">Jul</xsl:if>
<xsl:if test="$month = '08'">Aug</xsl:if>
<xsl:if test="$month = '09'">Sep</xsl:if>
<xsl:if test="$month = '10'">Oct</xsl:if>
<xsl:if test="$month = '11'">Nov</xsl:if>
<xsl:if test="$month = '12'">Dec</xsl:if> 
<xsl:value-of select="substring(@bet-start-time,0,3)" />:
<xsl:value-of select="substring(@bet-start-time,3)" /> 
</xsl:if>
<span class="bettypename">
<xsl:value-of select="@name" />
</span>
</td>
</tr>
<tr class="greytitle">
<td class="borderleft" align="left" style="padding-left:10px;">Selection</td>
<td class="borderright">Price</td>
</tr>
<xsl:for-each select="bet">
<tr onmouseover="this.className='selectionrowover'" onmouseout="this.className='selectionrow'" class="selectionrow" onclick="makebanner('{@id}', '{$affid}', '{@price}')">
<td class="player">
<xsl:value-of select="@name" />
</td>
<td class="price">
<xsl:value-of select="@price" />
</td>
</tr>
</xsl:for-each>
<tr>
<td> </td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Alex Vincent
06-14-2006, 06:44 PM
I don't see a namespace declared on your HTML element. Maybe that's related?

DELOCH
06-15-2006, 12:58 AM
sad sad sad, had the same problem

anyways, to help you it is simple,

<![CDATA[ tag, makes everything after it concidered useless xml extra, to allow it to work

a simple solution is:

<script>
// <![CDATA[
script goes here
// ]]>
</script>

your welcome :D