The following will select all of the span elements who's class attribute value evaluates to a number using the number() function and is equal to the same value.
//span[number(@class)=number(@class)]
A non-numeric value will evaluate to NaN
, which is unequal to any value (including NaN
) and returns false for the predicate test.