Jump to content

jamarogers

Members
  • Posts

    3
  • Joined

  • Last visited

About jamarogers

  • Birthday 12/22/1945

Previous Fields

  • Languages
    English

Contact Methods

  • Website URL
    http://jamarogers@bellsouth.net

Profile Information

  • Location
    Mendenhall, Mississippi
  • Interests
    Flight Simulation (MS FSXA) and all the demands that go with it(mission design, xml, xslt, SimVar, etc), gardening, grand kids.

jamarogers's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Why are there no code examples for the more difficult elements of Parameter or Varialble and functions like Sum and count? It is almost like enough help is posted to whet ones appetite only to pull away the goodies when you start to eat! My two bits...Jake
  2. Hi All, I'm a newbie here and to xml/xslt code. I've viewed the tutorials more than once and several on Youtube, but remain a bit confused with SUM(). Here's what I've got...an xml of what I think is called a flat structure(many Point elements to one Gather element). This xml is auto generated, so not much I can do about its format. Some of the data points (Point) are +(left of a flight path), while others are -(right of a flightpath). I wish to determine an average flght path deviation and don't really care whether its right(-) or left(+). I've figured out the code to sum them all, count and divide, but that does not give a true (absolute) deviation, since the negatives are subtracted from the positives.My thoughts are to sum all - and multiply by -1, then add back to sum of all + and divide by count of ALL.Here's my code:This works and outputs a list of ALL Point elements...<xsl:for-each select="Gather/Stat/Point"><xsl:value-of select="."/><xsl:text>, </xsl:text></xsl:for-each>This works and sums ALL values of Point...<xsl:for-each select="Gather/Stat"><xsl:text>SumOfAll = </xsl:text><xsl:value-of select="sum(Point)" /></xsl:for-each>This works and lists negative values of Point...<xsl:text>ListOfAllLT0 = </xsl:text><xsl:for-each select="Gather/Stat/Point"><xsl:if test=".<0"><xsl:value-of select="."/><xsl:text>, </xsl:text></xsl:if></xsl:for-each>Here's the problem, trying to sum negative values of Point...<xsl:for-each select="Gather/Stat"><xsl:text>SumOfAllLT0 = </xsl:text><xsl:if test=".<0"><xsl:value-of select="sum(Point)" /></xsl:if></xsl:for-each>Help PLEASE!!!Jake
  3. Hi All, I'm a newbie here and to xml/xslt code. I've viewed the tutorials more than once and several on Youtube, but remain a bit confused with SUM(). Here's what I've got...an xml of what I think is called a flat structure(many Point elements to one Gather element). This xml is auto generated, so not much I can do about its format. Some of the data points (Point) are +(left of a flight path), while others are -(right of a flightpath). I wish to determine an average flght path deviation and don't really care whether its right(-) or left(+). I've figured out the code to sum them all, count and divide, but that does not give a true (absolute) deviation, since the negatives are subtracted from the positives.My thoughts are to sum all - and multiply by -1, then add back to sum of all + and divide by count of ALL. Here's my code:This works and outputs a list of ALL Point elements...<xsl:for-each select="Gather/Stat/Point"> <xsl:value-of select="."/><xsl:text>, </xsl:text></xsl:for-each> This works and sums ALL values of Point...<xsl:for-each select="Gather/Stat"><xsl:text>SumOfAll = </xsl:text><xsl:value-of select="sum(Point)" /></xsl:for-each> This works and lists negative values of Point...<xsl:text>ListOfAllLT0 = </xsl:text><xsl:for-each select="Gather/Stat/Point"><xsl:if test=".<0"> <xsl:value-of select="."/><xsl:text>, </xsl:text></xsl:if></xsl:for-each> Here's the problem, trying to sum negative values of Point...<xsl:for-each select="Gather/Stat"><xsl:text>SumOfAllLT0 = </xsl:text><xsl:if test=".<0"><xsl:value-of select="sum(Point)" /></xsl:if></xsl:for-each> Help PLEASE!!!Jake
×
×
  • Create New...