TevyMuggigree
New Member
I checked almost every answer on the web and in many examples "following-sibling::text()[1]" is given as a correct answer to receive text after a strong-tag. I marked the text I'm interested in with asterisks:\[code\] <?php $html=' <html> <head> </head> <body> <div class="someclass"> <h2 class="h3">header 1</h2> <ul class="bulleted"> <li><strong>prop1: </strong>**name**</li> <li><strong>prop2: </strong>**street**</li> <li><strong>prop is 3: </strong>**city**</li> <li><strong>prop 4: </strong>**more**</li> </ul> </div> </body> </html>'; $doc = new DOMDocument(); $doc->strictErrorChecking = FALSE; $doc->loadHtml($html); $data = http://stackoverflow.com/questions/15776334/simplexml_import_dom($doc); $properties = $data->xpath('//strong/following-sibling::text()[1]'); var_dump($properties);\[/code\]What I always get is the content of the [strong], but not the text within the [li] [/li] without the content of [strong]:\[code\]array(4) { [0] => class SimpleXMLElement#3 (1) { public $strong => string(7) "prop1: " } [1] => class SimpleXMLElement#4 (1) { public $strong => string(7) "prop2: " } [2] => class SimpleXMLElement#5 (1) { public $strong => string(11) "prop is 3: " } [3] => class SimpleXMLElement#6 (1) { public $strong => string(8) "prop 4: " }}\[/code\]I would be glad if you point me to the error I do...