[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
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?
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|