[xsl] Sequential numbering temp trees

Subject: [xsl] Sequential numbering temp trees
From: Charles Pugh <charles.pugh@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Nov 2004 18:39:03 -0000
Hi

I am a bit of newbie ,

I am trying to create a temp tree of nodes to then use to number output rows
sequentially.

How do I create a temp tree using my templates and  then access the nodes of
my temp tree?

All attempts I have made seem to only result in a text string, and an error
that my "expression must evaluate to a node set".

Any examples would be a great help?

Here is some code that demonstrates my problem.

<?xml version="1.0"?>
<xslt:stylesheet version="1.0"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform";>

<xslt:output method="text" indent="no"/>

<xslt:template match="Results">

	<xslt:variable name="flattree">
		<xslt:apply-templates mode="phase1"/>
	</xslt:variable>

	<!-- This works... -->
	<xslt:value-of select="."/>

	<!-- ...this doesn't:
	<xslt:for-each select="$flattree">
		<xslt:value-of select="."/>
	</xslt:for-each>
	-->
</xslt:template>


<xslt:template match="*" mode="phase1">
	<xslt:value-of select="'myrecord'"/>
</xslt:template>

</xslt:stylesheet>


Thanks Charles



*****************************************************************************
******************
Did you know? Aligned Assets and Rochdale Metropolitan Borough Council have
qualified as finalists in the IM 2004 awards! Find out more at
http://www.aligned-assets.co.uk/aboutaa/im2004_awards.html

Current Thread