Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


using xsl variables in count()

From: "Ryan" <rlhuff@-----.--->
To: NULL
Date: 3/3/2005 8:03:00 AM
Hello. I'm trying to develop a dynamic report that will display
specific statistics about a given data set. The simplest example is
included below.

I'm iterating through the set and displaying the unique values of a
particular element (in the first column). Then, in the second column
I'm showing just a percentage of those values over the entire set
(part/whole %). The challenge is that I'm running into problems on this
line:
count(/dsQueryResponse/Rows/Row[normalize-space(@Status) =
'$uniqueStatus']/@ID)

It seems that "$uniqueStatus" is evaluated as a string -- not a
variable.

The question is, how do I access the value of the variable from here?

Another note... @Status has the same value as $uniqueStatus here. I
need to access one or the other.

I don't know if it's relevant, but this is from a SharePoint (WSS)
list.

Thanks!

<xsl:template name="dvt_1.footer">
  <xsl:param name="Rows"/>
  <table cellSpacing="0" cellPadding="4" border="0" width="100%">
    <tr>
      <td class="ms-vb"><b>Test Status</b></td>
      <td class="ms-vb"><b>% Overall</b></td>
    </tr>
    <xsl:for-each select="$Rows">
      <xsl:variable name="uniqueStatus" select="@Status"/>
      <xsl:if
test="generate-id()=generate-id(//Rows/Row[@Status=$uniqueStatus][1])">
        <TR>
          <TD Class="{$IDAPHEDF}">
            <xsl:value-of disable-output-escaping="no"
select="@Status"/>
          </TD>
          <TD Class="{$IDAPHEDF}">
            <xsl:value-of
select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) =
'$uniqueStatus']/@ID)"/>
            {<xsl:value-of select="$uniqueStatus" />} <!-- just for
display purposes -->
          </TD>
        </TR>
      </xsl:if>
    </xsl:for-each>
  </table>
</xsl:template>



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