Trouble...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an xml stored in a variable. If I load it in a domdocument as HTML:

$DDoc->loadHTML($xml);

I can get elements by an xpath query, but if I instead load it as XML my
xpath queries stop working:

$DDoc = new DOMDocument();
$DDoc->loadXML($xml);
$xpath = new DOMXPath($DDoc);

$query = "//li[@week=".$i."]";
$topics = $xpath->query($query);

I've checked that the xml is well formated, no error or warning is
displayed. $topics is just empty. Do anyone know why this could happen?
Thank you for your attention.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux