Mega Code Archive
Categories
/
Php
/
XML
XPath DOM Query
XPath DOM Query
load( "food.xml" ); $xp = new DomXPath( $dom ); $fruits = $xp -> query( "/food/fruit/item" ); foreach($fruits as $node) { echo( "
" . $node -> textContent . "
" ); } echo( "" ); ?>