Number Format Exception occured
<p>I'm using java and flex for my web application which will be used for institutes. 
If my result is mark then, less than 60 will be Re Appear RA. For grade system, U will Re Appear. But I'm facing <code>NumberFormatException</code> if result is grade system. Herewith I have attached my code. Please advise on this as soon as possible.</p>

<pre><code>XMLProcess xp = new XMLProcess();
try {
    Document doc = xp.processXml(xml);
    Element el = doc.getDocumentElement();
    NodeList nl = el.getElementsByTagName("batch");

    if (nl != null &amp;&amp; nl.getLength() &gt; 0) {
        for (int i = 0; i &lt; nl.getLength(); i++) {

            Element el1 = (Element) nl.item(i);
            NodeList nl1 = el1.getElementsByTagName("student");
            String schKey = el1.getAttribute("schkey");
            if (nl1 != null &amp;&amp; nl1.getLength() &gt; 0) {
                for (int j = 0; j &lt; nl1.getLength(); j++) {
                    String reAppear = "";
                    String sms = "";
                    Element el2 = (Element) nl1.item(j);
                    String studentName = el2.getAttribute("name");
                    String studentId = el2.getAttribute("id");
                    String studentKey = el2.getAttribute("key");
                    sms += "" + studentName + "\n";
                    sms += "Sem "
                            + sem.substring(sem.indexOf("-") + 1, sem.length())
                            + " "
                            + course
                            + "\n";
                    sms += "" + exam + "\n";

                    sms += (el2.getAttribute("mrg").equalsIgnoreCase("G")
                            ? "Sub: Grade"
                            : "Sub: Marks")
                            + "\n";
                    for (int k = 0;
                            k &lt; el2.getAttributes().getLength();
                            k++) {
                        String aName =
                                el2.getAttributes().item(k).getNodeName();
                        if (aName.equalsIgnoreCase("key")
                                || aName.equalsIgnoreCase("key")
                                || aName.equalsIgnoreCase("id")
                                || aName.equalsIgnoreCase("name")
                                || aName.equalsIgnoreCase("status")
                                || aName.equalsIgnoreCase("total")
                                || aName.equalsIgnoreCase("percentage")
                                || aName.equalsIgnoreCase("mrg")) {
                        } else {


                            sms += el2.getAttributes().item(k).getNodeName().substring(
                                    1)
                                    + ": "
                                    + (el2.getAttribute("mrg").equalsIgnoreCase("G")
                                    ? (el2.getAttributes().item(k).getNodeValue())
                                    : (Integer.parseInt(
                                    el2.getAttributes().item(k).getNodeValue())
                                    &lt; 60
                                    ? "RA"
                                    : el2.getAttributes().item(k).getNodeValue()))
                                    + "\n";

 /***Here exception occurs***/             if (Integer.parseInt(
                                    el2.getAttributes().item(k).getNodeValue())
                                    &lt;= 60) {
                                reAppear = "SM";

                            }
                            if (el2.getAttributes().item(k).getNodeValue()
                                    == "U") {
                                reAppear = "SG";

                            }

                        }
                    }
                    if (reAppear.equalsIgnoreCase("SM")) {
                        sms += "RA : FAIL LESS 60 marks. ";
                        sms += "Meet Principal/Director/HOD";
                    }
                    if (reAppear.equalsIgnoreCase("SG")) {
                        sms += "U - Fail Re Appear. ";
                        sms += "Meet Principal/Director/HOD";
                    }
</code></pre>
