[xsl] Can a named template return a node list?

Subject: [xsl] Can a named template return a node list?
From: John <john-xsl-list@xxxxxxxx>
Date: Thu, 16 Jun 2005 07:24:32 -0700
Sorry in advance for my terminology. Is it possible for a named template to return a node list? Here is some simplified XML with which I have been experimenting:

  <node1 attr="node1attrval">
  <node2 attr="node2attrval">

And the XSL I have been trying:

<xsl:template match="*">
  <xsl:variable name="somenode">
    <xsl:call-template name="sometemplate" />
  <xsl:value-of select="$somenode/@attr" />

<xsl:template name="sometemplate">
  <xsl:copy-of select="/root/node1" />

The reference to $somenode/@attr gives an error. I think the problem is with copy-of - I want it to return a reference to a node, but it seems to return the value of the node. Is there some other function or approach I should try? I have tried value-of and copy, and I am hoping to stay away from XSL extensions if possible. I cannot use XSL 2.



Current Thread