Well, first off, you could disable save and use a submit button instead and force the name to not have spaces... :)
If you can't use translate, how about substring and concat? Something like: concat(substring-before(../my:field1, " "), "%20", substring-after(../my:field1, " "))
To do multiple spaces, you'll have to use eval(eval(...)) trick to get it to concatenate. Might take 20 minutes to figure out the expression... but DOABLE.
Once again, though, you're better off just not letting them add spaces or special characters. Just translate those into nothing and force the save by submitting via a custom button in the form and disabling the file-save and file-saveas buttons.