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

Re: RE: syntax sugar for call-template

Subject: Re: RE: syntax sugar for call-template
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 16 Feb 2001 12:45:31 GMT
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


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.