Class XMLHelper

java.lang.Object
com.epam.admintool.XMLHelper

public class XMLHelper extends Object
Created with IntelliJ IDEA. User: wed Date: 21.11.12 Time: 14:41 To change this template use File | Settings | File Templates.
  • Method Details

    • protectSpecialCharacters

      public static String protectSpecialCharacters(String originalUnprotectedString)
      Returns the string where all non-ascii and <, &, > are encoded as numeric entities. I.e. "<A & B >" .... (insert result here). The result is safe to include anywhere in a text field in an XML-string. If there were no characters to protect, the original string is returned.
      Parameters:
      originalUnprotectedString - original string which may contain characters either reserved in XML or with different representation in different encodings (like 8859-1 and UFT-8)
      Returns:
    • restoreSpecialCharacters

      public static String restoreSpecialCharacters(String xml)