xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[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"
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
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor