The translate function takes string input and not a node -set. This means something like:
"translate(/xmlDoc/items/item/text(),'-','')"
or
"translate(/xmlDoc/items/item,'-','')"
will cause a function call only for the first node ( item[1] ).
In XPath 1.0, I think you have no other chance than doing something ugly:
"concat(translate(/xmlDoc/items/item,'-',''), translate(/xmlDoc/items/item[2],'-',''))"
Which is private for a huge list of elements, but returns only a string .
In XPath 2.0, this can be easily solved with the help of expressions :
"for $item in /xmlDoc/items/item return replace($item,'-','')"
Which returns the type of sequence :
abc cde
PS Do not confuse function calls with a location path . These are different expressions, and in XPath 1.0 you cannot mix.
source share