[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: order-by vs xsl:sort
> Nice result. horrible syntax though:-) How are you supposed to remember where to use "," where to use ";" and where to let the parser figure out where the expression ends? Here's a version that's accepted by saxon's xquery parser and gives the same result as before let $is := $data1/z/y , $js := $data2/z/y , $ci := count($is), $cj := count($js) for $n in (0 to ($ci * $cj -1)) let $i := $is[($n mod $ci)+1], $j := $js[($n idiv $ci) +1] order by ($j/@id - $i/@id) return concat($i/../@id,$j/../@id) The xslt expression is exactly the same except (as I commented in the original note) you can't sneak the variable binding in before the xsl:sort in the xsl version so the index expressions appear twice. They could be made into function calls though I suppose which would look nicer even if they still get evaluated twice. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|