Class XmlEntity

java.lang.Object
org.owasp.dependencycheck.xml.XmlEntity

@ThreadSafe public final class XmlEntity extends 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 Details

    • fromNamedReference

      public static String fromNamedReference(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