Is there any faster/easier way of finding a child node of a certain
DOMNode object than doing something like
function getChildByTagna me($curnode, $name)
{
foreach($curnod e->childNodes as $node)
{
if($node->nodeName==$nam e)
{
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
DOMNode object than doing something like
function getChildByTagna me($curnode, $name)
{
foreach($curnod e->childNodes as $node)
{
if($node->nodeName==$nam e)
{
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
Comment