Class InvalidXmlCharacterFilter

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

    public class InvalidXmlCharacterFilter
    extends Reader
    FilterInputStream that gets rid of characters that are invalid in an XML 1.0 document. Although these characters are forbidden, in the real wold they still appear in XML files. Java's SAX parser throws an exception, so we have to filter at a lower level. Only handles control characters (<0x20). Invalid characters are replaced by space (0x20).