[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: index-of and empty stuff

Subject: Re: index-of and empty stuff
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Sat, 21 Dec 2013 16:04:42 -0500
Re:  index-of and empty stuff

Let $s := '' (the empty string)

index-of(('a','b','c'),$s) -> 0
index-of(('a','b','c',''),$s) -> 4

Personally I am happy not to get 0, in either case, when $s is (). :-)

Cheers, Wendell

Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables

On Fri, Dec 20, 2013 at 12:50 PM, Ihe Onwuka <ihe.onwuka@xxxxxxxxx> wrote:
> if I am searching a sequence of strings with index-of having the empty
> string as the second argument will give me 0.
> Why throw  an error if the 2nd argument is empty sequence,
> irrespective of the type of the first argument.
> Isn't 0 the obvious answer here.

Current Thread


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.
First Name
Last Name
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.