This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RE: syntax sugar for call-template



   I've been - perhaps lazily - assuming that the implicit RTF -> nodeset
   conversion would convert any node structure into the same structure you
   started with. For instance if I return a node-set of node-sets I'm
   expecting this to be what the calling expression receives. Do you know
   of any exceptions, or are you just being cautious?


You can't get nodes from source documents into an node set generated
from an rtf (or in XSL 1.1 terminology) generated by an xsl:variable
with non empty content.

<xsl:variable name="beers" select="beer"/>

gives you a node set of all beer children of the current node.

<xsl:variable name="beers">
 <xsl:copy-of  select="beer"/>
</xsl:variable>

gives you an rtf in 1.0 but if you saxon:node-set() that, or use 1.1
you get a node set with _one_ node (a root node) containing a bunch
of beer nodes but they are _copies_ of the original nodes, not the same
nodes (so they have different generate-id() values, different parents
etc).

parent::beer in the first case will give you the original current node
in teh second case it will give the root node of the document.

There is no way for a named template to emulate copy-of which is one
reeasons why viewing XSLT functions as syntaxtic sugar for named
templates may not be quite the right thing and you need something like
saxon:return. 


David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]