[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:for - Only for existing nodes, how?
> This was just an example and my real xml > file goes much deeper after "control". if the expressions in the test are more complex it may help to stick them in a variable. <xsl:for-each select="/tree/controls/control"> <xsl:variable name="i1" select="ho/hum/ha"/> <xsl:variable name="i2" select="fee/fi/fo/fum"/> <xsl:if test="$i1 and $i2"> <xsl:value-of select="$i1"/> <xsl:value-of select="$i2"/> </xsl:if> </xsl:for-each> that way you don't have to repeat the expression both in the test and the value of. On the other hand it may make no difference as your xslt engine may spot repeated sub-expressions and effectively make them into implicit internal variables anyway. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|