Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: My xslt works in Firefox and not IE6.0 My xslt works in Firefox and not IE6.0To: NULL Date: 12/9/2005 11:57:00 AM I was trying to get my xsl file to work in Firefox, which I did, but
now it seems it doesn't work at all in IE6.0. I thought 6.0 used the
same standard as Firefox?
below is the js used to load the page:
<script type="text/javascript">
var isIE;
var isNav;
isIE = (navigator.appName == "Microsoft
Internet Explorer");
isNav = (navigator.appName == "Netscape");
if (isIE)
{
// Load XML
var xml = new
ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("StatsReport_allstats.xml")
// Load XSL
var xsl = new
ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("NodeStats2.xsl")
// Transform
document.write(xml.transformNode(xsl))
}
if (isNav)
{
//for mozilla/netscape
var processor = new XSLTProcessor();
var xslt =
document.implementation.createDocument("", "", null);
xslt.async = false;
xslt.load("NodeStats2.xsl");
processor.importStylesheet(xslt);
var src_doc =
document.implementation.createDocument("","", null);
src_doc.async = false;
src_doc.load("StatsReport_allstats.xml");
var result =
processor.transformToDocument(src_doc);
var xmls = new XMLSerializer();
var output =
xmls.serializeToString(result);
document.write(output);
alert("done");
}
</script>
I stuck a few alerts into the IE code, so I know the transform is
what's failing.
This is my stylesheet tag in my xsl:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="schema:StatsReportSchema.xml">
6.0 sp2 would load fine with the working draft:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
To have this work in both IE and Firefox do I have to duplicate my code
for both versions of xsl (that would be the only workaround I can think
of)? It still seems like really this ought to work for both, if they
both support the same versions. Do I need an IE update? Or is there
no way to have the same xsl stuff work for both and I really do just
need to duplicate everything for both browsers?
For extra clarity.. here is a simplified xml of what i'm using:
<?xml version="1.0" encoding="utf-8"?>
<StatsReport xmlns="schema:StatsReportSchema.xml"
xmlns:xsl="http://www/w3.org/1999/XSL/Transform">
<NodeStatistics Version="1.0">
<Summary>
<TimeSaved>11/30/2005 15:08:00</TimeSaved>
<Packets>165</Packets>
<Bytes>20243</Bytes>
<NodeCount>55</NodeCount>
</Summary>
<Stats>
<NodeStat>
<Addr>00:06:5B:97:37:CF</Addr>
<PacketsSent>4</PacketsSent>
<BytesSent>508</BytesSent>
<PacketsReceived>0</PacketsReceived>
<BytesReceived>0</BytesReceived>
</NodeStat>
<NodeStat>
<Addr>FF:FF:FF:FF:FF:FF</Addr>
<PacketsSent>0</PacketsSent>
<BytesSent>0</BytesSent>
<PacketsReceived>120</PacketsReceived>
<BytesReceived>13693</BytesReceived>
</NodeStat>
<NodeStat>
<Addr>00:40:80:76:50:00</Addr>
<PacketsSent>41</PacketsSent>
<BytesSent>6180</BytesSent>
<PacketsReceived>4</PacketsReceived>
<BytesReceived>1557</BytesReceived>
</NodeStat>
</Stats>
</NodeStatistics>
</StatsReport>
and here is my simplified xsl file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="schema:StatsReportSchema.xml">
<xsl:output
method="html"
version="4.0"
omit-xml-declaration="yes"
indent="yes"
encoding="iso-8859-1"
media-type="text/html"/>
<!-- Root template -->
<xsl:template match="/">
<html>
<head>
<title>Node Statistics</title>
<link href="StatsReport2.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<xsl:apply-templates select="ns1:StatsReport"/><br/>
</body>
</html>
</xsl:template>
another quick question for you xsl gurus out there:
with the following structure:
StatsReport
--NodeStatistics
----Summary
------Bytes
----Stats
------NodeStat
--------BytesSent
--------BytesReceived
I'm trying to access my Bytes node from inside a template for NodeStat,
a line like this:
<td class="rr"><xsl:value-of select="format-number((ns1:BytesSent div
ns1:StatsReport/NodeStatistics/Summary/Bytes), '##0.000%')"/>
I always get a NaN as a result. If I try to just select that node from
this template using the absolute path I get an empty result. Is there
a way I can access my Bytes node value from inside the NodeStat
template?
Thanks!
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
