semantics of substring()

"Howard Katz" <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
I don't understand one of the examples given for fn:substring() in the F and
O documentation [7.4.3]. The description of the function's behaviour says,
"If $startingLoc is zero or negative, the substring includes characters from
the beginning of the $sourceString." I take this to mean that

    substring( "12345", 0, 3 )

is equivalent to

    substring( "12345", 1, 3 )

which I understand evaluates to "123".

The example shown in the documentation however returns "12", and Saxon
echoes this. What am I misunderstanding?

TIA,
Howard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.