title: org.xml.sax.SAXParseException: Premature end file
body: <p>I currently have the following <code>XML</code> file.</p>
  
  <p><a href="http://www.cse.unsw.edu.au/~cs9321/14s1/assignments/musicDb.xml" rel="noreferrer">http://www.cse.unsw.edu.au/~cs9321/14s1/assignments/musicDb.xml</a></p>
  
  <p>My <code>XMLParser.java</code> class.</p>
  
  <pre><code>package edu.unsw.comp9321.assignment1;
  
  import java.io.File;
  import javax.xml.parsers.DocumentBuilder;
  import javax.xml.parsers.DocumentBuilderFactory;
  import org.w3c.dom.Document;
  
  public class XMLParser {
  
  
  public void search () {
  
      try{
          File fXmlFile = new File("/COMP9321Assignment1/xml/musicDb.xml");           
          DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
          Document doc = dBuilder.parse(fXmlFile);
  
          System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I create an object in another class and call the <code>search</code> but I keep receiving the above stated error.</p>
  
  <p>Would anyone know what the problem might be?</p>
  
  <p>Thanks for your help.</p>