com.epam.admintool
Class XMLHelper

java.lang.Object
  extended by 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.


Constructor Summary
XMLHelper()
           
 
Method Summary
static String protectSpecialCharacters(String originalUnprotectedString)
          Returns the string where all non-ascii and <, &, > are encoded as numeric entities.
static String restoreSpecialCharacters(String xml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLHelper

public XMLHelper()
Method Detail

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 was 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)


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.