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

Silly Newbie XML question

Subject: Silly Newbie XML question
From: "LAJ" <shaard@xxxxxxxxxxxxxx>
Date: Tue, 3 Jul 2001 12:50:24 +0100
last name laj
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"
version="1.0">

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

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

</xsl:template>

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

</xsl:stylesheet>

The xml can be anything that uses this stylesheet.

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

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

Lee


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


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-2013 All Rights Reserved.