title: xpath searching with php
body: <p>I am attempting to search an XML document using XPATH with a value from a form but i am met with a number of errors.</p>
  
  <blockquote>
    <p>Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid
    expression on line 17 </p>
    
    <p>Warning: SimpleXMLElement::xpath()
    [simplexmlelement.xpath]: xmlXPathEval: evaluation failed on line 17</p>
    
    <p>Warning: Invalid argument supplied for foreach() on line 21</p>
  </blockquote>
  
  <p>holidays.xml snippet</p>
  
  <pre><code>&lt;channel&gt;
      &lt;item&gt;
            &lt;title&gt;Holiday description&lt;/title&gt; 
            &lt;link&gt;link&lt;/link&gt; 
            &lt;description&gt;Holiday description&lt;/description&gt; 
            &lt;pubDate&gt;Sun, 13 Feb 2011 11:58:17 GMT&lt;/pubDate&gt; 
            &lt;guid&gt;http://site&lt;/guid&gt; 
        &lt;/item&gt;
  &lt;/channel
  </code></pre>
  
  <p>txtSearch is the text value taken from the form. Can anyone shed any light on fixing these errors?</p>