coding4humanists / xquery4humanists

Companion website for XQuery for Humanists (previously hosted at xquery.forhumanists.org)
https://coding4humanists.github.io/xquery4humanists/
11 stars 3 forks source link

cardinality of fn:string() #10

Open djbpitt opened 4 years ago

djbpitt commented 4 years ago

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.