How can I strip invalid XML characters from strings in Perl?
- by AndrewR
I'm looking for what the standard, approved, and robust way of stripping invalid characters from strings before writing them to an XML file. I'm talking here about blocks of text containing backspace (^H) and formfeed characters etc.
There has to be a standard library/module function for doing this but I can't find it.
I'm using XML::LibXML to build a DOM tree that I then serialize to disk.