Hi,
I am new to XML. I have a questions regarding DOM.
<root>
<demo demoatt="testat tr">This is PCDATA</domo>
</root>
The book I read presents 2 ways to get This is PCDATA
(1) selectsinglenod e("/root/demo").nodevalu e
(2) selectsinglenod e("/root/demo[0]").firstchild.n odevalue
Why do I need to use firstchild in the 2nd method? Thanks.
I am new to XML. I have a questions regarding DOM.
<root>
<demo demoatt="testat tr">This is PCDATA</domo>
</root>
The book I read presents 2 ways to get This is PCDATA
(1) selectsinglenod e("/root/demo").nodevalu e
(2) selectsinglenod e("/root/demo[0]").firstchild.n odevalue
Why do I need to use firstchild in the 2nd method? Thanks.
Comment