parsin XML with DOM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,

could somebody give me some direction here.

i am trying to build a RSS 2.0 parser using DOM. what puzzles me is the following -

i get the XML -

$RSS_XML = file_get_contents($params['uri']);

then i instantiate a DOM object -

$RSS_DOM = new DomDocument();

then i load the XML -

$RSS_DOM->loadXML($RSS_XML);

then i get the first node -

$NODE = $RSS_DOM->firstChild;

here $NODE->tagName is "rss", so far OK

but then if i get the first child of "rss", which is "channel" -

$NODE = $NODE->firstChild;

its type is not DomNode, but DomText.

Only the 2nd child -

$NODE = $NODE->nextSibling;

has $NODE->tagName "channel".

My question is - why is the first child after "rss" DomText?

Thank you,
Iv

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux