Min/Max from a node set
I'm back!!! Can't use xslt 2.0 because FlightSimulatorX uses 1.0. Can't use min or max functions or Sort since they aren't in 1.0....
Is there any way to use Variables to extract min or max from a nodeset? I've hacked for 2 days now but no luck...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="356.51129"/>
<Profile name="Cnt" value="5.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="491347698">-0.04583</Point>
<Point Time="491347938">-2.67923</Point>
<Point Time="491348254">-0.55264</Point>
<Point Time="491348494">3.31936</Point>
<Point Time="491348719">0.35047</Point>
<Point Time="491348852">-1.95970</Point>
<Point Time="491349006">-0.96952</Point>
<Point Time="491349066">-0.47092</Point>
<Point Time="491349126">0.45476</Point>
<Point Time="491349186">0.89227</Point>
<Point Time="491349246">1.18413</Point>
<Point Time="491349306">1.03627</Point>
<Point Time="491350034">6.56656</Point>
<Point Time="491350274">9.36668</Point>
<Point Time="491350514">11.00141</Point>
<Point Time="491350754">13.37342</Point>
<Point Time="491350994">10.43424</Point>
<Point Time="491351200">-4.00423</Point>
<Point Time="491351260">-3.10856</Point>
<Point Time="491351490">-1.00002</Point>
<Point Time="491351890">2.23850</Point>
<Point Time="491351974">3.05697</Point>
<Point Time="491352033">2.95752</Point>
<Point Time="491352092">2.22562</Point>
<Point Time="491352152">4.54936</Point>
<Point Time="491352212">2.08890</Point>
<Point Time="491352435">0.52381</Point>
<Point Time="491352676">4.52694</Point>
<Point Time="491352915">10.33114</Point>
<Point Time="491353204">13.74132</Point>
<Point Time="491353264">4.11866</Point>
<Point Time="491353324">-6.53613</Point>
<Point Time="491353384">-5.67728</Point></Stat></Gather>
<State/>
<Checksum>A1F673D1EB6CFB0C0B1A957B6BEB5A05</Checksum></MissionProfile>
...and my xslt
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:variable name="max1" select="string(.)"/>
<xsl:template match="/MissionProfile">
<html>
<h2>Here's your maximum Dead Reckoning course variation in decimiles:</h2>
<body>
<br/>
<xsl:text>Max Course Variation = </xsl:text>
<xsl:for-each select="Gather/Stat">
<xsl:sort select="Point"/>
<xsl:if test="position()=last()">
<last>"."</last>
</xsl:if>
<!-- <xsl:value-of select="Point"/><xsl:text>, </xsl:text> -->
</xsl:for-each>
<br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks for any help, as I'm approaching burnout, but I know I'm so close to a solution.
Last edited by JakeRogers; November 2nd, 2013 at 02:57 AM..
|