I've cobbled together some code that nearly works (simplified)...
Code: Select all
$xPathDom = new DOMDocument();
@$xPathDom->loadHTML( $frameContentsStg );
$xPath = new DOMXPath( $xPathDom );
$matches = $xPath->query( "//div" );
foreach ( $matches as $match ){
$recordContentsAy[] = $match->nodeValue;
}
I worked out that the '->query' method returns a type 'DOMNodeList' but when I look at the php documentation (which I usually find to be very good) the only property it mentions is 'item'. http://uk.php.net/manual/en/class.domnodelist.php
Searching for 'nodeValue' in the documentation returns loads of pages but I could only find references in PHP code snippets.
Can some one please point me to a link that describes teh 'nodeValue' property and a list of the other properties and methods for use on things returned by an XPath query. Or is there a better resource that explains this fully.
Thanks.