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

RE: Purpose of generate-id index [1]

Subject: RE: Purpose of generate-id index [1]
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 25 Jun 2003 09:23:20 +0100
re purpose
> >>In general terms why is the [1] index present.
> 
> As you noticed, it is redundant. Two reasons why it is still 
> commonly used: 1. Make it explicit to human readers that the 
> first element
>    of the node set returned by key() is used. Not everybody
>    has always all details of the spec at hand.
> 2. Moderatly clever processors might take the index as a clue
>    not to construct the whole node set, which can save time and
>    memory. Really clever processors could take the same clue
>    from the presence of the generate-id() function of course,
>    but the former is still a bit easier to implement and also
>    more worth to do because the optimization is also an improvement
>    in many more situations.
> 

A third reason, better than either of these: when you move to XSLT 2.0,
and switch off "backwards compatibility" mode, it will become an error
to supply a sequence of nodes to a function that's designed to handle
only one. So if you really want to process just the first node, you have
to say so.

Michael Kay



 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.