[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: "Hansen, John" <John.Hansen@xxxxxxxxxx>
Date: Thu, 8 Apr 2004 10:19:45 -0700
from first to las
You may have missed my follow-up posts on this topic.  Almost
immediately after I posted my question I realized that the solution was
quite simple.  

My friend's task was to take XML containing dates at various nesting
levels, find the earliest date, find the latest date, generate an HTML
table with a column for every calendar date from earliest to latest
(whether or not those dates happen to exist in the XML).  He already has
a fairly-complicated set of templates that he uses to generate the
proper HTML output (one of which takes a start and a stop date as
parameters).  He just couldn't figure out how to obtain both the
earliest and the latest dates from the input XML in order to then call
his named template with those two dates.  

I posted my solution yesterday.  It involved two for-each loops with the
first sorting by date and then calling a template when position()=1 with
the current node as the parameter.  That template contained a for-each
loop sorting by date which called the desired template when
position()=last() with the parameter it received and the current node.

The processing architecture of this particular problem is Internet
Explorer (our web services output XML with stylesheet references which
is processed by the browser).  That makes it kind of difficult to
pipeline transformations.

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?

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.