Re: [xml] Traversing a XML Document

Dinesh Ahuja writes:

The output of this function come as :
Root Node Name is : story
Element Name is : text

Can anyone explain me why this text is coming and from
where this node with a name text has come ?

From the text node inside your story element.
It's only whitespace but it's still text.

Please let me know whether I am right in making the
changes in above function.

sure. If you're only interested in elements you should leave out
other node types. A positive check for element nodes would make more
sense though...


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