title: xpath error in the php code - Invalid Expression
body: <p>I am getting this error, </p>
  
  <p><code>Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid expression</code>. </p>
  
  <p>Searched in internet but could not remove this error. That is im posting it one more time.</p>
  
  <p>Here is my php code:</p>
  
  <pre><code>&lt;?php
              $file = $_POST['id'];
              $xml = simplexml_load_file('test.xml');
  
              $user = $xml-&gt;xpath("user[user_id == $id]");             
              $name = $user-&gt;name;
              $file = $user-&gt;file;
              echo 'Name' . $name;
              echo 'File Name' . $file;
  ?&gt;
          &lt;form action='&lt;?php echo $_SERVER['PHP_SELF']?&gt;' method="POST"&gt;
              Login ID: &lt;input type="text" name="id" /&gt;
              &lt;input type="submit" name="submit" value="Submit"/&gt;               
          &lt;/form&gt; 
  </code></pre>
  
  <p>And my test.xml file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;document&gt;
      &lt;user&gt;
          &lt;user_id&gt;0121&lt;/user_id&gt;
          &lt;name&gt;Tim&lt;/name&gt;
          &lt;file&gt;0121.file&lt;/file&gt;
      &lt;/user&gt;
      &lt;user&gt;
          &lt;user_id&gt;0178&lt;/user_id&gt;
          &lt;name&gt;Henry&lt;/name&gt;
          &lt;file&gt;0178.file&lt;/file&gt;
      &lt;/user&gt;
      &lt;user&gt;
          &lt;user_id&gt;0786&lt;/user_id&gt;
          &lt;name&gt;Martin&lt;/name&gt;
          &lt;file&gt;0786.file&lt;/file&gt;
      &lt;/user&gt;
      &lt;user&gt;
          &lt;user_id&gt;1239&lt;/user_id&gt;
          &lt;name&gt;Jan&lt;/name&gt;
          &lt;file&gt;1239.file&lt;/file&gt;
      &lt;/user&gt;
  &lt;/document&gt;
  </code></pre>
  
  <p>Any reason?</p>
  
  <p>Thanks
  Raaks</p>