[xsl] Silly Newbie XML question

Subject: [xsl] Silly Newbie XML question
From: "LAJ" <shaard@xxxxxxxxxxxxxx>
Date: Tue, 3 Jul 2001 12:50:24 +0100
Sorry to bother you all with something trivial but I was hoping I could get
an explanation of something.

A bit of background : Im using the document function to look up some
information in another XML file from an XSLT template. Im having to call
this template 3 times in order to retrieve *slightly* different output.
Ideally what Id like to do is call one template once and return a
dynamically generated tree fragment, return it to a variable and then output
the individual nodes. I've had no luck doing this so I put together a
simplified example of my problem.

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

<xsl:template match="/">
	<xsl:variable name="test">
		<xsl:call-template name="test"/>

	<xsl:value-of select="$test//node1"/>
	<xsl:value-of select="$test//node2"/>
	<xsl:value-of select="$test//node3"/>


<xsl:template name="test">
		<node1>data refererenced from another document</node1>
		<node2>slightly different data refererenced from the same document as
		<node3>slightly different data refererenced from the same document as


The xml can be anything that uses this stylesheet.

<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="/test.xsl" ?>

Now when I try this I get the error "reference to parameter or varibale test
must evaluate to a node list".

What am I doing wrong or have I fundamentally misunderstood something here?
Im using MSXML3.0 BTW

Many thanks


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread