You are here: Re: DOM child finding « PHP Programming Language « IT news, forums, messages
Re: DOM child finding

Posted by Sean on 04/24/07 09:55

"skrebbel" <e.pear.teeselink@student.apple.tue.banana.nl> wrote in message
news:op.tq95l61r18tlcy@s011169.mshome.net...
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==$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




I would have thought that you could probably narrow it down with an XPATH
query, but without seeing the XML and what you're after, it's a little hard
to consider what you are looking for.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация