From this Q&A: Replace attribute values for all attributes
My first idea was to use a StringReplacer to replace every attribute with '0' if it matched the regex '^0*$' (0 or more '0'), '1' otherwise.
I thought it should work theoretically, but the StringReplacer replaced '0' with '1' in fact.
If you set a character (e.g. 'x') other than '0' to the Replacement Text parameter, it worked fine.
I'm afraid that there could be a bug here. See also the attached workspace.
(FME 2018.1.0.3)
Original:
Unexpected Result: Every <empty> was replace with '0', but '0' was replaced with '1'.
Comparison: Every '0' and <empty> was replaced with 'x'.