XPATH - apply function to multiple nodes

I have some XML that is tructured as follows:

<test>
<sub1 type="foo1">31-10</sub1>
<sub1 type="foo1">32-20</sub1>
<sub1 type="foo1">33</sub1>
<sub1 type="foo2">34-20</sub1>
</test>

I want to use an XPath to select a substring of the text in certain "sub1" nodes. What I want to end up with are the following text nodes:

31
32
34

I can use substring-before(//sub1[@type="foo1"]/text(), '-') to get the first one, "31", but cannot figure out how to get all of them in a single call. Any suggestions how I can do this with a single XPath without using any additional XSL would be greatly appreciated.
[738 byte] By [jkerr5] at [2007-11-19 11:40:26]
# 1 Re: XPATH - apply function to multiple nodes
I don't think this is possible.

The problem is that the substring-before function takes two string arguments, when you feed it a nodeset it will cast this to a string using the string(nodeset) function which only returns the string value of the first node.
khp at 2007-11-10 3:27:25 >