P. 67 says that the fn:string() function accepts any number of XML nodes, but the actual cardinality is zero or one (unlike fn:data(), which you discuss on the same page, which has cardinality of zero or more). fn:string() processes multiple nodes in your example because it is invoked independently for each of them, but if you try to pass all of them at once (fn:string(//title) if there is more than one <title> element), it raises an error.
P. 67 says that the
fn:string()
function accepts any number of XML nodes, but the actual cardinality is zero or one (unlikefn:data()
, which you discuss on the same page, which has cardinality of zero or more).fn:string()
processes multiple nodes in your example because it is invoked independently for each of them, but if you try to pass all of them at once (fn:string(//title)
if there is more than one<title>
element), it raises an error.