Class XmlCharSet

java.lang.Object
ch.tocco.nice2.util.xml.XmlCharSet

public final class XmlCharSet extends Object
  • Method Details

    • contains

      public static boolean contains(char c)
      Returns true if the given character is a valid xml character as defined in http://www.w3.org/TR/xml11/#charsets.
    • removeInvalidChars

      public static String removeInvalidChars(CharSequence data)
      Returns a new string without characters considered invalid xml characters.
    • removeInvalidXmlEntities

      public static String removeInvalidXmlEntities(String xml)
      Removes invalid xml entities from the string. These are xml encoded chars, which are invalid for xml, for example the char ' ' would be encoded to ' ' or ' '.
    • filterInvalidXmlEntities

      public static InputStream filterInvalidXmlEntities(Reader reader) throws IOException
      Consumes the given reader and returns a new input stream which has no invalid xml entities.
      Throws:
      IOException
    • filterInvalidXmlEntities

      public static InputStream filterInvalidXmlEntities(InputStream in) throws IOException
      Consumes the given input stream and returns a new stream which has no invalid xml entities left. The input stream is converted to characters using UTF-8 charset.
      Throws:
      IOException
    • toValidXml

      public static InputStream toValidXml(InputStream xml) throws IOException
      Consumes the given stream and returns a new one where invalid characters and invalid xml entities have been removed. The input stream is converted to characters using UTF-8 charset.
      Throws:
      IOException
    • toValidXml

      public static InputStream toValidXml(Reader xml) throws IOException
      Consumes the given reader and returns a new one where invalid characters and invalid xml entities have been removed.
      Throws:
      IOException