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

Re: XSLT 1.1 comments - the chocolate hobnob challenge

Subject: Re: XSLT 1.1 comments - the chocolate hobnob challenge
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Feb 2001 12:39:14 +0000
max in xslt 1.1
Francis Norton wrote:
> I think there is an pretty substantial requirement for extension
> functions that could be coded in XSLT - off the top of my head:
[snip]
>         set functions (obviously we're using XSLT 1.1 RTF conversion to
> node-sets here):
>                 eg max(), min(), same-node() and various grouping functions 

I'm sure everyone's aware of this, but just to make a point about
manipulating node sets in XSLT templates.

   <xsl:variable name="foo">
      <xsl:copy-of select="bar" />
   </xsl:variable>

is not the same as:

   <xsl:variable name="foo" select="bar" />

A generated RTF that holds a copy of a node is different from the node
itself in several ways, some of which may be problematic when you come
to use it. In particular:

  * it has different relationships with other (ancestor and sibling) nodes
  * it has a different base URI
  * it has a different result for generate-id()

This isn't a problem for functions like max(), min() or even
same-node() because they don't return node sets, but if you're doing
intersection() or difference() then it does make a difference. Which
is why you need something like saxon:return to return node-set values
- it isn't enough to return RTFs, even if they can be treated as node
sets. To bring in another thread, it isn't enough to simply add syntax
sugar to the calling of named templates.

[I'm wondering whether I can turn the horrific XPath-parsing stuff I
did for XSLTDoc into some kind of XSLT-driven saxon:expression()...]

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.