I am trying to parse some basic html using xpath and running into issues. The returned output is always empty using what I am reading the xpath docs to say works. Below is my first attempt at making this work. Any help is appreciated as always guys and gals.
$html = '<ul>';
$html .= ' <li id="stuff-12345"> some content here </li>';
$html .= ' <li id="stuff-54321"> some other content here </li>';
$html .= '</ul>';
$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$result = $xpath->query('//ul/li');
foreach($result as $e){
echo $e->item(0)->nodeValue . "\n";
}