title: How to get href value from XML file on java eclipse DOM
body: <p>I have an XML file in the format:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
      &lt;company&gt;
      &lt;tr&gt;
      &lt;td align="center" style="width:50px;"&gt;9850&lt;/td&gt;
      &lt;td align="center" style="width:150px;"&gt;Europe&lt;/td&gt;
      &lt;td align="center" style="width:150px;"&gt;Ukraine&lt;/td&gt;
      &lt;td align="center" style="width:100px;"&gt;Kiev&lt;/td&gt;
      &lt;td align="center"&gt;&lt;a href="details.aspx?page=default&amp;amp;post=99664"&gt;Kiev 1&lt;/a&gt; &lt;/td&gt; 
      &lt;/tr&gt;
   &lt;/company&gt;
  </code></pre>
  
  <p><strong>My program</strong></p>
  
  <pre><code>import javax.xml.parsers.DocumentBuilderFactory;
  
  import javax.xml.parsers.DocumentBuilder;
  
  import org.w3c.dom.Document;
  
  import org.w3c.dom.NodeList;
  
  import org.w3c.dom.Node;
  
  import org.w3c.dom.Element;
  
  import java.io.File;
  
  public class Myversion { public static void main(String argv[])  {
  
          try { File myfile = new File("/Users/Nik/Downloads/1.xml");
  
      DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
  
      DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
  
      Document doc = dBuilder.parse(myfile);
  
      doc.getDocumentElement().normalize();
  
      NodeList nodeList = doc.getElementsByTagName(doc.getDocumentElement().getChildNodes().item(1).getNodeName());;
  
      for (int temp = 0; temp &lt; nodeList.getLength(); temp++) {
  
      Node nNode = nodeList.item(temp);
  
      if (nNode.getNodeType() == Node.ELEMENT_NODE) {
  
      Element element = (Element) nNode;
  
      System.out.print("id"+temp+" "+element.getElementsByTagName("td").item(0).getTextContent());
      System.out.print(" "+element.getElementsByTagName("td").item(1).getTextContent());
      System.out.print(" "+element.getElementsByTagName("td").item(2).getTextContent());
      System.out.print(" "+element.getElementsByTagName("td").item(3).getTextContent());
      System.out.print(" "+element.getElementsByTagName("td").item(4).getTextContent());
  
      }}} catch (Exception e) {e.printStackTrace();}}}
  </code></pre>
  
  <p><strong>Output:</strong>  </p>
  
  <pre><code>id0 98500 Europe Ukraine Kiev Kiev 1
  </code></pre>
  
  <p>How can ia get value of href ? What need to put in code to output link ? </p>