How to OR query expressions in XPATH

bypeClealaMaroa

New Member
I'm trying to extract hrefs, srcs and value attributes from a HTML string using xpath\[code\] $dom = new DOMDocument; libxml_use_internal_errors(true); $dom->loadHTML (stripslashes ($content)); $xpath = new DOMXPath ($dom); libxml_clear_errors(); $doc = $dom->getElementsByTagName('html')->item(0); $srcs = $xpath->query('.//@src'); $hrefs = $xpath->query ('.//@href'); $values = $xpath->query ('.//@value');\[/code\]How can I combine the xpath query expressions with OR ? This way I would have only have one array to traverse.
 
Back
Top