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

RE: Getting the first and last nodes of a sorted nodes

Subject: RE: Getting the first and last nodes of a sorted nodeset
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 08 Apr 2004 13:26:35 -0400
node xslt
Hi John,

It's good to know you're so far ahead with this. Sorry if the posts crosses: lists do that sometimes.

At 01:19 PM 4/8/2004, you wrote:
How do you "Bind the result of your sort to a variable" when (so far as
I am aware) you can only sort output elements from within a for-each or
apply-templates by using the xsl:sort element?

<xsl:variable name="sorted-result"> <xsl:apply-templates> <xsl:sort/> </xsl:apply-templates> </xsl:variable>

The thing is, in XSLT 1.0 this variable is now a Result Tree Fragment, a datatype that can be copied to output and that can be operated on as a string, but that can't be operated on as a node set. As you can imagine, the latter feature would be (is) extremely powerful -- and is what the node-set() extension function is for. (So exsl:node-set($sorted-result) turns this RTF into a node set you can apply templates to.) In XSLT 2.0, it's a node set already when it's created, so you can reprocess $sorted-result freely, no differently from your source document.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.