| 
	
 | 
 Posted by skrebbel on 04/24/07 08:52 
Is there any faster/easier way of finding a child node of a certain  = 
 
DOMNode object than doing something like 
 
function getChildByTagname($curnode, $name) 
{	= 
 
	foreach($curnode->childNodes as $node) 
	{ 
		if($node->nodeName=3D=3D$name) 
		{ 
			return $node; 
		} 
	} 
} 
 
? 
 
it seems fairly slow and cumbersome. i was thinking xpath, but i can  = 
 
hardly imagine that to be a lot faster, with all the DOMXpath object  = 
 
creation and all, though I didn't benchmark. 
 
-egbert
 
  
Navigation:
[Reply to this message] 
 |