[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xpath 2.0 expressions
> After Mike and Jeni's comments re brevity [complexity?] > I find it unusual to mandate the else clause in > the if, then, else. It's a conditional expression rather than a conditional instruction; with a conditional instruction, doing nothing in the else branch is a reasonable default, but with conditional expressions, most languages require both branches to be explicit. It would certainly be possible to return () (the empty sequence) if the else branch is omitted, but I don't know whether this would really be a good idea. In the cases where it's what you want you can usually rewrite it as a predicate: Instead of for $i in //item return (if (exists($i/@value)) then $i/@value else ()) write for $i in //item[@value] return $i/@value Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|