XPATH - apply function to multiple nodes
<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.

