Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: My xslt works in Firefox and not IE6.0

From: "Chris Lovett" <chris@------.--->
To: NULL
Date: 12/10/2005 5:25:00 PM
This is a multi-part message in MIME format.

------=_NextPart_000_007D_01C5FDAE.9B589DA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

You need to change the progid to new =
ActiveXObject("MSXML2.DOMDocument");

In IE6 you can also just change your XML file to have this at the top:
<?xml-stylesheet href=3D"test.xsl" type=3D"text/xsl"?>

then launch the XML file  and get the result you are looking for.  But =
if you have to run script, there is a better way to do it in IE6.  You =
can put the XML and XSL in an XML data island which allows IE to manage =
the downloading (which is faster) and then when you get the onload event =
you run the transform as follows:

<body>
    <xml src=3D"StatsReport_allstats.xml" id=3D"XML"></xml>
    <xml src=3D"NodeStats2.xsl" id=3D"XSL"></xml>
    <script for=3D"window" event=3D"onload" language=3D"javascript">
        var isIE =3D (navigator.appName =3D=3D "Microsoft Internet =
Explorer");
        var isNav =3D (navigator.appName =3D=3D "Netscape");
        if (isIE)
        {=20
            // Transform
            document.write(XSL.transformNode(XML.XMLDocument))
        } else {
            ...


PS: you don't need: xmlns:xsl=3D"http://www/w3.org/1999/XSL/Transform" =
in your XML file.





<meena.shah@g...> wrote in message =
news:1134158233.165541.101030@g......
>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?
>=20
> below is the js used to load the page:
>=20
>        <script type=3D"text/javascript">
>                var isIE;
>                var isNav;
>                        isIE =3D (navigator.appName =3D=3D "Microsoft
> Internet Explorer");
>                        isNav =3D (navigator.appName =3D=3D =
"Netscape");
>=20
>                        if (isIE)
>                        {
>                                // Load XML
>                                var xml =3D new
> ActiveXObject("Microsoft.XMLDOM")
>                                xml.async =3D false
>                                xml.load("StatsReport_allstats.xml")
>=20
>                                // Load XSL
>                                var xsl =3D new
> ActiveXObject("Microsoft.XMLDOM")
>                                xsl.async =3D false
>                                xsl.load("NodeStats2.xsl")
>=20
>                                // Transform
>                                document.write(xml.transformNode(xsl))
>                        }
>                        if (isNav)
>                        {
>                                //for mozilla/netscape
>                                var processor =3D new XSLTProcessor();
>                                var xslt =3D
> document.implementation.createDocument("", "", null);
>                                xslt.async =3D false;
>                                xslt.load("NodeStats2.xsl");
>                                processor.importStylesheet(xslt);
>=20
>                                var src_doc =3D
> document.implementation.createDocument("","", null);
>                                src_doc.async =3D false;
>=20
> src_doc.load("StatsReport_allstats.xml");
>                                var result =3D
> processor.transformToDocument(src_doc);
>                                var xmls =3D new XMLSerializer();
>                                var output =3D
> xmls.serializeToString(result);
>                                document.write(output);
>                                alert("done");
>                        }
>=20
>        </script>
>=20
> 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=3D"1.0"
>=20
> xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
>                xmlns:ns1=3D"schema:StatsReportSchema.xml">
>=20
> 6.0 sp2 would load fine with the working draft:
> <xsl:stylesheet version=3D"1.0" =
xmlns:xsl=3D"http://www.w3.org/TR/WD-xsl">
>=20
> 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?
>=20
> For extra clarity.. here is a simplified xml of what i'm using:
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
> <StatsReport xmlns=3D"schema:StatsReportSchema.xml"
> xmlns:xsl=3D"http://www/w3.org/1999/XSL/Transform">
> <NodeStatistics Version=3D"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>
>=20
> and here is my simplified xsl file:
> <?xml version=3D"1.0" encoding=3D"ISO-8859-1" ?>
> <xsl:stylesheet version=3D"1.0"
> xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
>                xmlns:ns1=3D"schema:StatsReportSchema.xml">
> <xsl:output
> method=3D"html"
> version=3D"4.0"
> omit-xml-declaration=3D"yes"
> indent=3D"yes"
> encoding=3D"iso-8859-1"
> media-type=3D"text/html"/>
>=20
> <!-- Root template -->
> <xsl:template match=3D"/">
> <html>
> <head>
> <title>Node Statistics</title>
> <link href=3D"StatsReport2.css" type=3D"text/css" rel=3D"stylesheet"/>
> </head>
> <body>
> <xsl:apply-templates select=3D"ns1:StatsReport"/><br/>
> </body>
> </html>
> </xsl:template>
>=20
>=20
> another quick question for you xsl gurus out there:
> with the following structure:
> StatsReport
> --NodeStatistics
> ----Summary
> ------Bytes
> ----Stats
> ------NodeStat
> --------BytesSent
> --------BytesReceived
>=20
> I'm trying to access my Bytes node from inside a template for =
NodeStat,
> a line like this:
> <td class=3D"rr"><xsl:value-of select=3D"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?
>=20
> Thanks!
>

------=_NextPart_000_007D_01C5FDAE.9B589DA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>You need to change the progid to new=20
ActiveXObject("MSXML2.DOMDocument");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In IE6 you can also just change your =
XML file to=20
have this at the top:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff size=3D2>
<P>&lt;?</FONT><FONT color=3D#800000 size=3D2>xml-stylesheet</FONT><FONT =

color=3D#0000ff size=3D2> </FONT><FONT color=3D#808080 =
size=3D2>href=3D"test.xsl"=20
type=3D"text/xsl"</FONT><FONT color=3D#0000ff size=3D2>?&gt;</FONT></P>
<P><FONT size=3D2>then launch the XML file&nbsp; and get the result you =
are=20
looking for.&nbsp; B</FONT>ut if you have to run script, there is a =
better way=20
to do it in IE6.&nbsp; You can put the XML and XSL in an XML data island =
which=20
allows IE to manage the downloading (which is faster) and then when you =
get the=20
onload event you run the transform as follows:</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff size=3D2>
<P>&lt;</FONT><FONT color=3D#800000 size=3D2>body</FONT><FONT =
color=3D#0000ff=20
size=3D2>&gt;<BR>&nbsp;&nbsp;&nbsp; </FONT><FONT color=3D#0000ff><FONT=20
size=3D2>&lt;</FONT></FONT><FONT color=3D#800000 =
size=3D2>xml</FONT><FONT size=3D2>=20
</FONT><FONT color=3D#ff0000 size=3D2>src</FONT><FONT color=3D#0000ff=20
size=3D2>=3D"StatsReport_allstats.xml"</FONT><FONT size=3D2> =
</FONT><FONT=20
color=3D#ff0000 size=3D2>id</FONT><FONT color=3D#0000ff=20
size=3D2>=3D"XML"&gt;&lt;/</FONT><FONT color=3D#800000 =
size=3D2>xml</FONT><FONT=20
color=3D#0000ff size=3D2>&gt;<BR>&nbsp;&nbsp;&nbsp; </FONT><FONT =
color=3D#0000ff=20
size=3D2>&lt;</FONT><FONT color=3D#800000 size=3D2>xml</FONT><FONT =
size=3D2>=20
</FONT><FONT color=3D#ff0000 size=3D2>src</FONT><FONT color=3D#0000ff=20
size=3D2>=3D"NodeStats2.xsl"</FONT><FONT size=3D2> </FONT><FONT =
color=3D#ff0000=20
size=3D2>id</FONT><FONT color=3D#0000ff =
size=3D2>=3D"XSL"&gt;&lt;/</FONT><FONT=20
color=3D#800000 size=3D2>xml</FONT><FONT color=3D#0000ff=20
size=3D2>&gt;<BR>&nbsp;&nbsp;&nbsp; </FONT><FONT color=3D#0000ff=20
size=3D2>&lt;</FONT><FONT color=3D#800000 size=3D2>script</FONT><FONT =
size=3D2>=20
</FONT><FONT color=3D#ff0000 size=3D2>for</FONT><FONT color=3D#0000ff=20
size=3D2>=3D"window"</FONT><FONT size=3D2> </FONT><FONT color=3D#ff0000=20
size=3D2>event</FONT><FONT color=3D#0000ff =
size=3D2>=3D"onload"</FONT><FONT size=3D2>=20
</FONT><FONT color=3D#ff0000 size=3D2>language</FONT><FONT =
color=3D#0000ff=20
size=3D2>=3D"javascript"&gt;</FONT><FONT=20
size=3D2><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT=20
color=3D#0000ff>var</FONT><FONT size=3D2> </FONT>isIE =3D =
(navigator.appName =3D=3D=20
</FONT><FONT color=3D#800000 size=3D2>"Microsoft Internet =
Explorer"</FONT><FONT=20
size=3D2>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT =
color=3D#0000ff=20
size=3D2>var</FONT><FONT size=3D2> </FONT>isNav =3D (navigator.appName =
=3D=3D </FONT><FONT=20
color=3D#800000 size=3D2>"Netscape"</FONT><FONT=20
size=3D2>);<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT=20
color=3D#0000ff size=3D2>if</FONT><FONT size=3D2>=20
(isIE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT><FONT color=3D#008000 size=3D2>// Transform<BR><FONT=20
color=3D#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
</FONT></FONT><FONT=20
size=3D2>document.write(XSL.transformNode(XML.XMLDocument))<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
} else =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
...</FONT><FONT size=3D2><BR></FONT></FONT><BR><BR><FONT face=3DArial =
size=3D2>PS: you=20
don't need: xmlns:xsl=3D"http://www/w3.org/1999/XSL/Transform" in your =
XML=20
file.</FONT></P><FONT face=3DArial size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<P>&nbsp;</P>
<P><BR><BR>&lt;meena.shah@g...&gt; wrote in message=20
news:1134158233.165541.101030@g......<BR>&gt;I =
was=20
trying to get my xsl file to work in Firefox, which I did, but<BR>&gt; =
now it=20
seems it doesn't work at all in IE6.0.&nbsp; I thought 6.0 used =
the<BR>&gt; same=20
standard as Firefox?<BR>&gt; <BR>&gt; below is the js used to load the=20
page:<BR>&gt; <BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;script=20
type=3D"text/javascript"&gt;<BR>&gt;&nbsp;&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20
var src_doc =3D<BR>&gt; document.implementation.createDocument("","",=20
null);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
src_doc.async =3D false;<BR>&gt; <BR>&gt;=20
src_doc.load("StatsReport_allstats.xml");<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
var result =3D<BR>&gt;=20
processor.transformToDocument(src_doc);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
var xmls =3D new=20
XMLSerializer();<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
var output =3D<BR>&gt;=20
xmls.serializeToString(result);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
document.write(output);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
alert("done");<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
}<BR>&gt; <BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/script&gt;<BR>&gt; <BR>&gt; I stuck a few alerts into the IE code, =
so I=20
know the transform is<BR>&gt; what's failing.<BR>&gt; This is my =
stylesheet tag=20
in my xsl:<BR>&gt; &lt;xsl:stylesheet version=3D"1.0"<BR>&gt; <BR>&gt;=20
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<BR>&gt;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
xmlns:ns1=3D"schema:StatsReportSchema.xml"&gt;<BR>&gt; <BR>&gt; 6.0 sp2 =
would load=20
fine with the working draft:<BR>&gt; &lt;xsl:stylesheet version=3D"1.0"=20
xmlns:xsl=3D"http://www.w3.org/TR/WD-xsl"&gt;<BR>&gt; <BR>&gt; To have =
this work=20
in both IE and Firefox do I have to duplicate my code<BR>&gt; for both =
versions=20
of xsl (that would be the only workaround I can think<BR>&gt; of)?&nbsp; =
It=20
still seems like really this ought to work for both, if they<BR>&gt; =
both=20
support the same versions.&nbsp; Do I need an IE update?&nbsp; Or is=20
there<BR>&gt; no way to have the same xsl stuff work for both and I =
really do=20
just<BR>&gt; need to duplicate everything for both browsers?<BR>&gt; =
<BR>&gt;=20
For extra clarity.. here is a simplified xml of what i'm using:<BR>&gt; =
&lt;?xml=20
version=3D"1.0" encoding=3D"utf-8"?&gt;<BR>&gt; &lt;StatsReport=20
xmlns=3D"schema:StatsReportSchema.xml"<BR>&gt;=20
xmlns:xsl=3D"http://www/w3.org/1999/XSL/Transform"&gt;<BR>&gt; =
&lt;NodeStatistics=20
Version=3D"1.0"&gt;<BR>&gt; &lt;Summary&gt;<BR>&gt; =
&lt;TimeSaved&gt;11/30/2005=20
15:08:00&lt;/TimeSaved&gt;<BR>&gt; =
&lt;Packets&gt;165&lt;/Packets&gt;<BR>&gt;=20
&lt;Bytes&gt;20243&lt;/Bytes&gt;<BR>&gt;=20
&lt;NodeCount&gt;55&lt;/NodeCount&gt;<BR>&gt; &lt;/Summary&gt;<BR>&gt;=20
&lt;Stats&gt;<BR>&gt; &lt;NodeStat&gt;<BR>&gt;=20
&lt;Addr&gt;00:06:5B:97:37:CF&lt;/Addr&gt;<BR>&gt;=20
&lt;PacketsSent&gt;4&lt;/PacketsSent&gt;<BR>&gt;=20
&lt;BytesSent&gt;508&lt;/BytesSent&gt;<BR>&gt;=20
&lt;PacketsReceived&gt;0&lt;/PacketsReceived&gt;<BR>&gt;=20
&lt;BytesReceived&gt;0&lt;/BytesReceived&gt;<BR>&gt; =
&lt;/NodeStat&gt;<BR>&gt;=20
&lt;NodeStat&gt;<BR>&gt; =
&lt;Addr&gt;FF:FF:FF:FF:FF:FF&lt;/Addr&gt;<BR>&gt;=20
&lt;PacketsSent&gt;0&lt;/PacketsSent&gt;<BR>&gt;=20
&lt;BytesSent&gt;0&lt;/BytesSent&gt;<BR>&gt;=20
&lt;PacketsReceived&gt;120&lt;/PacketsReceived&gt;<BR>&gt;=20
&lt;BytesReceived&gt;13693&lt;/BytesReceived&gt;<BR>&gt;=20
&lt;/NodeStat&gt;<BR>&gt; &lt;NodeStat&gt;<BR>&gt;=20
&lt;Addr&gt;00:40:80:76:50:00&lt;/Addr&gt;<BR>&gt;=20
&lt;PacketsSent&gt;41&lt;/PacketsSent&gt;<BR>&gt;=20
&lt;BytesSent&gt;6180&lt;/BytesSent&gt;<BR>&gt;=20
&lt;PacketsReceived&gt;4&lt;/PacketsReceived&gt;<BR>&gt;=20
&lt;BytesReceived&gt;1557&lt;/BytesReceived&gt;<BR>&gt;=20
&lt;/NodeStat&gt;<BR>&gt; &lt;/Stats&gt;<BR>&gt; =
&lt;/NodeStatistics&gt;<BR>&gt;=20
&lt;/StatsReport&gt;<BR>&gt; <BR>&gt; and here is my simplified xsl=20
file:<BR>&gt; &lt;?xml version=3D"1.0" encoding=3D"ISO-8859-1" =
?&gt;<BR>&gt;=20
&lt;xsl:stylesheet version=3D"1.0"<BR>&gt;=20
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<BR>&gt;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
xmlns:ns1=3D"schema:StatsReportSchema.xml"&gt;<BR>&gt; =
&lt;xsl:output<BR>&gt;=20
method=3D"html"<BR>&gt; version=3D"4.0"<BR>&gt; =
omit-xml-declaration=3D"yes"<BR>&gt;=20
indent=3D"yes"<BR>&gt; encoding=3D"iso-8859-1"<BR>&gt;=20
media-type=3D"text/html"/&gt;<BR>&gt; <BR>&gt; &lt;!-- Root template=20
--&gt;<BR>&gt; &lt;xsl:template match=3D"/"&gt;<BR>&gt; =
&lt;html&gt;<BR>&gt;=20
&lt;head&gt;<BR>&gt; &lt;title&gt;Node Statistics&lt;/title&gt;<BR>&gt; =
&lt;link=20
href=3D"StatsReport2.css" type=3D"text/css" =
rel=3D"stylesheet"/&gt;<BR>&gt;=20
&lt;/head&gt;<BR>&gt; &lt;body&gt;<BR>&gt; &lt;xsl:apply-templates=20
select=3D"ns1:StatsReport"/&gt;&lt;br/&gt;<BR>&gt; &lt;/body&gt;<BR>&gt; =

&lt;/html&gt;<BR>&gt; &lt;/xsl:template&gt;<BR>&gt; <BR>&gt; <BR>&gt; =
another=20
quick question for you xsl gurus out there:<BR>&gt; with the following=20
structure:<BR>&gt; StatsReport<BR>&gt; --NodeStatistics<BR>&gt;=20
----Summary<BR>&gt; ------Bytes<BR>&gt; ----Stats<BR>&gt; =
------NodeStat<BR>&gt;=20
--------BytesSent<BR>&gt; --------BytesReceived<BR>&gt; <BR>&gt; I'm =
trying to=20
access my Bytes node from inside a template for NodeStat,<BR>&gt; a line =
like=20
this:<BR>&gt; &lt;td class=3D"rr"&gt;&lt;xsl:value-of=20
select=3D"format-number((ns1:BytesSent div<BR>&gt;=20
ns1:StatsReport/NodeStatistics/Summary/Bytes), '##0.000%')"/&gt;<BR>&gt; =
I=20
always get a NaN as a result.&nbsp; If I try to just select that node=20
from<BR>&gt; this template using the absolute path I get an empty =
result.&nbsp;=20
Is there<BR>&gt; a way I can access my Bytes node value from inside the=20
NodeStat<BR>&gt; template?<BR>&gt; <BR>&gt;=20
Thanks!<BR>&gt;</FONT></P></DIV></BODY></HTML>

------=_NextPart_000_007D_01C5FDAE.9B589DA0--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent