title: Unable to catch XML exception/error in PHP
body: <p>I am not able to catch exception with below code. Can anyone help me with this thing?</p>
  
  <pre><code>try
  {
      $xml_emp_name = $xpath-&gt;evaluate("//EMPLOYEES[ID='" . $emp_id . "']/EMP-NAME/text()")-&gt;item(0)-&gt;nodeValue;
  }
  catch(Exception $e)
  {
      echo "Error: " . $e-&gt;getMessage();
  }
  </code></pre>