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

Re: Designs for XSLT functions (Was: Re: RE: syntax su

Subject: Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 11:35:22 +0000
Re: Designs for XSLT functions (Was: Re:  RE: syntax su
Hi Miloslav,

>> I agree that for string manipulation, there's not much call for
>> anything very sophisticated, and you can always call out to a named
>> template if you need to. However, for node-set manipulation that's
>> not always an option - you can't get a named template to return a
>> node set.
>
> Actually you can:

Jeez, you really have to watch your terminology on this list! :)

> <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
version = "1.0" >> 

Note above version is 1.0.

> <xsl:variable name="xxx">
>   <xsl:call-template name="nodeset"/>
> </xsl:variable>

Therefore this variable is set to an RTF as its set by content.

> <xsl:template name="nodeset">
>   <aaa>1</aaa>
>   <aaa>2</aaa>
>   <aaa>3</aaa>
> </xsl:template>

This template returns an RTF anyway.

> <xsl:template match="/">
>   <xsl:value-of select="$xxx/aaa[2]"/>
> </xsl:template>

And this template will return an error on any conforming XSLT 1.0
processor because it tries to turn the RTF into a node set implicitly
(later versions of Saxon aren't conformant in this area).

But that's me being picky to get you back ;) I think that you were
talking about in XSLT 1.1? Sure, there named templates can return a
newly-created node set. However they *cannot* return a node set
consisting of already existing nodes such as those in the original
source document - only their copies. This is a major limiting factor
when you want to do set functions like intersection().

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.