E.g. "32-48" -> 32.0
This string parsing behavior is maybe acceptable for strings being passed into a math function, but it's completely unacceptable here. Also, it's useful for debugging to be able to get hexadecimal UNIDs, rather than converting them to int32.
I'd suggest xmlGetAttrib should only convert to a number if all the characters in the string are numerals, except for up to one E/e (which isn't first or last), up to one decimal point (before the E if present and not first), and up to two - signs (only at the start and directly after an E).
Math and equality functions should probably convert valid hexadecimals, but otherwise they could use the same standard.