[Home] [By Thread] [By Date] [Recent Entries]
At 05:00 PM 11/4/2004, you wrote:
Yes, in XPath 1.0 only the first node in a node-set is used when one value is expected -- there's no distinction b/n functions and operators in this respect. Cheers, Dimitre. Dimitre might not have phrased it with perfect strictness, but I'm pretty sure what he intended to say is true. :-> You are correct that the casting of a node-set to a Boolean casts a set to a single value (true or false depending on whether the set has any members). But no operations or functions in XPath 1.0 are defined explicitly to take Boolean arguments only (or at least my brain is drawing a blank on this), whereas a number of them (concat() etc.) do take only string values (which are necessarily each "one value"). So the casting rule for Booleans isn't really relevant here. generate-id() is a little special since it is defined to take a node-set as its argument, but *returns* a single string (the string value of the generated id of a node), so it becomes necessary to define which node in the set will be the one whose ID is returned. Following the same logic as the casting rule of node-set to string, the function takes the first node in the set (in document order). Cheers, Wendell
|

Cart



