Re: [PHP] Re: parsin XML with DOM

2007-07-05 Thread 邱慧剑

Maybe you can set preserveWhiteSpace to ignore whitespace,like this:
$RSS_DOM = new DomDocument();
$RSS_DOM-preserveWhiteSpace = false;


On 6/27/07, M. Sokolewicz [EMAIL PROTECTED] wrote:


Mikey wrote:
 [EMAIL PROTECTED] wrote:
 [snip]

 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


 My guess is the whitespace between the nodes :o)

 HTH,

 Mikey
You are correct on that guess. In xml everything is (part of) a node. So
if you have:
node node2 / /node
You'll actually have:
DomNode(node)
DomText( )
DomNode(node2)
DomText( )
Same goes for newlines, as they are seen as text, thus part of a DomText
node.

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




[PHP] Re: parsin XML with DOM

2007-06-26 Thread Mikey

[EMAIL PROTECTED] wrote:
[snip]


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



My guess is the whitespace between the nodes :o)

HTH,

Mikey

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



[PHP] Re: parsin XML with DOM

2007-06-26 Thread M. Sokolewicz

Mikey wrote:

[EMAIL PROTECTED] wrote:
[snip]


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



My guess is the whitespace between the nodes :o)

HTH,

Mikey
You are correct on that guess. In xml everything is (part of) a node. So 
if you have:

node node2 / /node
You'll actually have:
DomNode(node)
 DomText( )
 DomNode(node2)
 DomText( )
Same goes for newlines, as they are seen as text, thus part of a DomText 
node.


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