[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Re: What is $p in the definition of fn:subsequence
> The spec doesn't specify the desired behavior if $length is <= 0. > > Should the function return the empty sequence, a reversed > subsequence (if $length is < 0) or should an error be raised? > The same question goes for fn:substring(). > I think these questions are answered by the equivalences given in the (corrected) spec. subsequence((1 to 10), 5, -3) is equivalent to (1 to 10)[5 le position() and position() lt 5 - 3] which is an empty sequence. The same applies to substring(). (Note, in case you are wondering why it is this way: subsequence was deliberately designed to imitate substring(), and substring() was designed on the 1.0 design principle of "no runtime errors except as a last resort") Michael Kay http://www.saxonica.com/
|
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
|