Global Variable not working
Hi All, I'm using Win7 64bit and bound to xslt 1.0. Here's my xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='MissionProfile.xsl'?>
<MissionProfile>
<Profile name="BHP" value="290000"/>
<Profile name="EOT" value="357.37405"/>
<Profile name="Cnt" value="4.00000"/>
<Profile name="Fire" value="1"/>
<Profile name="SIMVAR_VERSION" value="V1.0.3537.0"/>
<Gather>
<Stat ID="" Name="GPS WP CROSS TRK" Unit="decimile">
<Point Time="491347703">-2.48798</Point>
<Point Time="491348136">-2.64524</Point>
<Point Time="491348196">-2.66696</Point>
<Point Time="491348256">-1.66871</Point>
<Point Time="491348316">-0.92799</Point>
<Point Time="491348376">0.03788</Point>
<Point Time="491348436">-2.93716</Point>
<Point Time="491349017">0.08978</Point>
<Point Time="491349254">1.99864</Point>
<Point Time="491349494">0.35377</Point>
<Point Time="491349734">-0.36690</Point>
<Point Time="491350078">-0.08624</Point>
<Point Time="491350318">-2.99009</Point>
<Point Time="491350558">-2.87822</Point>
<Point Time="491350798">-3.59886</Point>
<Point Time="491351038">-4.02558</Point>
<Point Time="491351412">0.61559</Point>
<Point Time="491351472">0.97038</Point>
<Point Time="491351567">1.48383</Point>
<Point Time="491351628">2.38179</Point>
<Point Time="491351688">3.36402</Point>
<Point Time="491351748">2.27463</Point>
<Point Time="491351808">2.34239</Point>
<Point Time="491351868">2.22555</Point>
<Point Time="491351928">3.25894</Point>
<Point Time="491351988">2.30689</Point>
<Point Time="491352048">1.43087</Point>
<Point Time="491352349">-3.12652</Point>
<Point Time="491352589">-7.61186</Point>
<Point Time="491353022">-1.21697</Point>
<Point Time="491353503">-9.89016</Point>
<Point Time="491353627">1.77874</Point></Stat></Gather>
<State/>
<Checksum>3A2063E82F9B0C0DD450D8BAD5C81CFA</Checksum></MissionProfile>
Here's my xsl:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:template match="/MissionProfile">
<html>
<h2>Here's your Dead Reckoning results:</h2>
<body>
<xsl:variable name="points"
select="Gather/Stat/Point" />
<xsl:variable name="minNumber"
select="$points[not (. > $points)]" />
<xsl:for-each select="Gather">
<xsl:value-of select ="$minNumber"/>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
This works fine extracting the minimum value (used as a local variable), BUT when I move variables (4 lines of code) up and below xsl stylesheet declaration (to use as a Global Variable), it does NOT work. Can anyone help with the mystery of using a Global Variable in 1.0? Thanks Much for any help as I've exhausted my own resources...
Jake
|