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

Re: Entry not outputting anything - Blank.

Subject: Re: Entry not outputting anything - Blank.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Mar 2008 10:49:55 GMT
Re:  Entry not outputting anything - Blank.
Ypu haven't said what transformation you are tyrying to do, or posted
any input or a full stylesheet that can be run, but some comments on one
of your templates



	<xsl:template name="cur_time_duration_cifo">
 		<xsl:param name="value"/>
 
 		<xsl:for-each
 select="document($currentJTL_cifo)/testResults/*[not(@label = 
 preceding::*/@label)]">
 			<xsl:variable name="label" select="@label" />


<!--
This variable $label is never used, so you don't need to define it (saxon will
 have made a warning about this)

 -->
 
 			<xsl:variable name="minTimeStamp_prev_2">
 				<xsl:call-template 
 name="find_minTimeStamp_prev_2">
 					<xsl:with-param 
 name="nodes" select="/testResults/sampleResult" />
 				</xsl:call-template>
 			</xsl:variable>
 
 			<xsl:variable name="maxTimeStamp_prev_2">
 				<xsl:call-template 
 name="find_maxTimeStamp_prev_2">
 					<xsl:with-param 
 name="nodes" select="/testResults/sampleResult" />
 				</xsl:call-template>
 			</xsl:variable>
 
 			<xsl:variable name="timeSpan" 
 select="$maxTimeStamp_prev_2 - $minTimeStamp_prev_2" />

<!--
This variable is only used in one place so you don't really need it, you
 			could just move this code to the xsl:with-param
 			line.
-->
 			<xsl:if test="position() = last()">

<!--
You are in a for-each loop and do nothing except set some variables in
every iteration except the last so in all cases except the last the
variables are not used and setting them is a wast of time (it's wquite
likely that the system spots this, and never evaluates them at all.

Whenevr you have 
<xsl:for-each select="something">
<xsl:if test="position()=last()">
  ...
</xsl:if>
</xsl:for-each>

Then you should simply not evaluate the code on teh nodes other than the
last and instead do

<xsl:for-each select="(something)[position()=last()]">

</xsl:for-each>


so that only the last one is processed.
-->

 				<xsl:call-template 
 name="display-seconds">
 					<xsl:with-param 
 name="value" select="$timeSpan"/>
 				</xsl:call-template>
 			</xsl:if>
 
 		</xsl:for-each>
 
 		<xsl:value-of select="$value"/>
 		
 		
 	</xsl:template>
 

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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-2007 All Rights Reserved.