title: How to Parse XML Response of Http Post in Java
body: <p>I have an XML response from HTTP POST of this form </p>
  
  <pre><code>&lt;PaymentResponse&gt;&lt;TransDate&gt;301111&lt;/TransDate&gt;&lt;TransTime&gt;011505&lt;/TransTime&gt;&lt;SourceID&gt;0&lt;/SourceID&gt;&lt;Balance&gt;0&lt;/Balance&gt;&lt;ResponseCode&gt;06&lt;/ResponseCode&gt;&lt;ResponseMessage&gt;Error XXXX&lt;/ResponseMessage&gt;&lt;ApprovalCode&gt;DECL&lt;/ApprovalCode&gt;&lt;ApprovalAmount&gt;0&lt;/ApprovalAmount&gt;&lt;/PaymentResponse&gt;
  </code></pre>
  
  <p>But I am unable to parse it using Sax parser. Kindly help me out.
  regards</p>
  
  <p>I am using this code </p>
  
  <pre><code>public void endElement(String uri, String localName, String qName) throws SAXException  { 
      if(localName.equalsIgnoreCase("TransDate"))
      {
          int tD = Integer.parseInt(currentValue); 
          tempResponse.setTDate(tD); 
      }
  </code></pre>
  
  <p>But every time localName comes with empty string. </p>