Jon,
well - last time I programmed with SAX was in Java and its "many moons" ago - so I'm not sure, but I thought we were able to access the raw XML stream in the SAX "event handler" - but as I said, it's long ago, and my memory might not serve me right.
The pattern matching with regular expressions is quite normal at any other platform - and it's also quite handy, because you're even able to check for contents inside the "substring" - and all that without having to code long %scan and %subst expressions.
You can also test and develop your regular expressions on several websites (e.g. regex101.com) and your SQL interactively - not so easy with a complex %scan and %subst expression.
Regular expressions might be somehow unfamiliar for us (the seasoned RPG programmers) but it's mainstream for nearly all others. So I think of it as some sort of "future proofing" an application.
And finally to speed/performance - we all know what Hoare said: Premature optimization is the root of all evil. So I didn't make any assumptions about performance as I don't know if it's in fact a factor.
But if performance might be a problem, it's possible to compile the regular expression and apply it multiple times using the highly optimized C library - from an RPG programmers POV this a huge PITA but it's very fast at runtime.
Regards,
Daniel
#RPG