Class XmlEntity


  • @ThreadSafe
    public final class XmlEntity
    extends java.lang.Object
    This is a utility class to convert named XML Entities (such as ø) into its HTML encoded Unicode code point (i.e. ø). This is a slightly modified (class/method rename) from an SO answer: https://stackoverflow.com/questions/7286428/help-the-java-sax-parser-to-understand-bad-xml
    Author:
    https://stackoverflow.com/users/823393/oldcurmudgeon
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fromNamedReference​(java.lang.CharSequence s)
      Converts a named XML entity into its HTML encoded Unicode code point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fromNamedReference

        public static java.lang.String fromNamedReference​(java.lang.CharSequence s)
        Converts a named XML entity into its HTML encoded Unicode code point.
        Parameters:
        s - the named entity (note, this should not include the leading '&' or trailing ';'
        Returns:
        the HTML encoded Unicode code point representation of the named entity