// Path: src/main/java/org/tmpotter/util/Localization.java
// public static final String getString(final String strKey) {
//     return (_bundle.getString(strKey));
// }
// 
// Path: src/main/java/org/tmpotter/util/StringUtil.java
// public static String format(String str, Object... arguments) {
//     str = str.replaceAll("'", "''");
//     return MessageFormat.format(str, arguments);
// }
// 
// Path: src/main/java/org/tmpotter/exceptions/TranslationException.java
// @SuppressWarnings("serial")
// public class TranslationException extends Exception {
//     /**
//      * Constructs an instance of <code>TranslationException</code> with the
//      * specified detail message.
//      *
//      * @param msg the detail message.
//      */
//     public TranslationException(String msg) {
//         super(msg);
//     }
// 
//     /**
//      * Constructs an instance of <code>TranslationException</code> with the
//      * specified detail message and cause.
//      *
//      * @param msg   the detail message.
//      * @param cause cause the cause
//      */
//     public TranslationException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// }


import org.tmpotter.exceptions.TranslationException;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import static org.tmpotter.util.Localization.getString;
import static org.tmpotter.util.StringUtil.format;
        clearCache();

        String valString = val.toString();
        if (valString.equals("amp")) {
            return '&';
        } else if (valString.equals("lt")) {
            return '<';
        } else if (valString.equals("gt")) {
            return '>';
        } else if (valString.equals("apos")) {
            return '\'';
        } else if (valString.equals("quot")) {
            return '"';
        } else if (entityFilter != null) {
            return entityFilter.convertToSymbol(val.toString());
        }

        // else, binary data
        if (hex) {
            try {
                cp = Integer.valueOf(valString, 16);
            } catch (NumberFormatException ex) {
                throw new TranslationException("XSR-020:"
                        + format(getString("XSR.ERROR.BAD_BINARY_CHAR"), val), ex);
            }
            if (!XMLUtil.isValidXMLChar(cp)) {
                throw new TranslationException("XSR-021:"
                        + format(getString("XSR.ERROR.BAD_BINARY_CHAR"), val));
            }
        } else {
// Path: src/main/java/org/tmpotter/util/Localization.java
// public static final String getString(final String strKey) {
//     return (_bundle.getString(strKey));
// }
// 
// Path: src/main/java/org/tmpotter/util/StringUtil.java
// public static String format(String str, Object... arguments) {
//     str = str.replaceAll("'", "''");
//     return MessageFormat.format(str, arguments);
// }
// 
// Path: src/main/java/org/tmpotter/exceptions/TranslationException.java
// @SuppressWarnings("serial")
// public class TranslationException extends Exception {
//     /**
//      * Constructs an instance of <code>TranslationException</code> with the
//      * specified detail message.
//      *
//      * @param msg the detail message.
//      */
//     public TranslationException(String msg) {
//         super(msg);
//     }
// 
//     /**
//      * Constructs an instance of <code>TranslationException</code> with the
//      * specified detail message and cause.
//      *
//      * @param msg   the detail message.
//      * @param cause cause the cause
//      */
//     public TranslationException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// }


// Path: src/main/java/org/tmpotter/util/xml/XMLStreamReader.java
import org.tmpotter.exceptions.TranslationException;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import static org.tmpotter.util.Localization.getString;
import static org.tmpotter.util.StringUtil.format;

        clearCache();

        String valString = val.toString();
        if (valString.equals("amp")) {
            return '&';
        } else if (valString.equals("lt")) {
            return '<';
        } else if (valString.equals("gt")) {
            return '>';
        } else if (valString.equals("apos")) {
            return '\'';
        } else if (valString.equals("quot")) {
            return '"';
        } else if (entityFilter != null) {
            return entityFilter.convertToSymbol(val.toString());
        }

        // else, binary data
        if (hex) {
            try {
                cp = Integer.valueOf(valString, 16);
            } catch (NumberFormatException ex) {
                throw new TranslationException("XSR-020:"
                        + format(getString("XSR.ERROR.BAD_BINARY_CHAR"), val), ex);
            }
            if (!XMLUtil.isValidXMLChar(cp)) {
                throw new TranslationException("XSR-021:"
                        + format(getString("XSR.ERROR.BAD_BINARY_CHAR"), val));
            }
        } else {
            try {