[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Xpath problem?

Subject: RE: Xpath problem?
From: "Seth Foss" <seth.foss@xxxxxxxxxxx>
Date: Wed, 28 Jun 2006 10:38:33 -0400
jmeter xpath
After further testing, I realize that the template "max" isn't being
called at all. I changed the value when there are no nodes from NaN to
MAX, but it continues to display NaN. However, changes I make to the xsl
outside of that template work.

If possible, I'm more confused than I was before. The template named max
should be called by call-templates name="max", right? Other places in
the xsl call templates the same way, and work fine. Anyone have any

-----Original Message-----
From: Seth Foss [mailto:seth.foss@xxxxxxxxxxx]
Sent: Wednesday, June 28, 2006 9:36 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Xpath problem?

I am using an integration of Apache Ant and Apache JMeter that comes
with xsl files to process the results of a JMeter test. Knowledge of
either of these programs shouldn't be necessary to answer my question.

Almost the entire report (html format) generates correctly, except for
some instances where two specific templates are called, with preselected
nodes passed in.

Here are some snippets of the code:
<xsl:variable name="allMaxTime">
  <xsl:call-template name="max">
    <xsl:with-param name="nodes" select="/testResults/*/@t" />
<xsl:template name="max">
  <xsl:param name="nodes" select="/.." />
    <xsl:when test="not($nodes)">NaN</xsl:when>
      <xsl:for-each select="$nodes">
        <xsl:sort data-type="number" order="descending" />
        <xsl:if test="position() = 1">
          <xsl:value-of select="number(.)" />
And the xml looks like this:
<testResults version="1.2">
  <httpSample t="290" lt="0" ts="1151499119860" s="true"
              lb="ATO Summit Home" rc="302" rm="Moved Temporarily"
              tn="Thread Group 1-1" dt="">

The problem is, even though i have multiple entries of these
httpSamples, the result of the "max" template always is NaN, even though
a max value should be returned.

If I take the for-each loop outside the template, and run it without
calling the template, it works fine, and the select="/testResults/*/@t"
is used in other places in the XSL that work.

If anyone can tell me what the error is, and what the code should like
like instead, I would be very grateful.


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.