フォームからの値でXPATHを使用してXML文書を検索しようとしていますが、いくつかのエラーが発生しました。xpath PHPで検索
警告:にSimpleXMLElement ::のXPath()[simplexmlelement.xpath]:ライン上の無効 式17
警告:にSimpleXMLElement ::のXPath() [simplexmlelement.xpath]:xmlXPathEval:評価に失敗しましたライン17
警告:foreachのために供給される無効な引数()ラインで21
holidays.xmlは
をスニペット<channel>
<item>
<title>Holiday description</title>
<link>link</link>
<description>Holiday description</description>
<pubDate>Sun, 13 Feb 2011 11:58:17 GMT</pubDate>
<guid>http://site</guid>
</item>
</channel
txtSearchは、フォームから取得したテキスト値です。誰もこれらのエラーを修正する上で光を当てることはできますか?この
$qry = sprintf('channel/item[contains(., "%s")]', $txtSearch);
し、それが動作するはずの