xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiwanka Somasiri <asthiwa...@gmail.com>
Subject Difference between Document.getNodeValue() and Document.getTextContent()?
Date Fri, 15 Apr 2011 17:37:21 GMT
Hi all,

    I wrote a sample program parse an XML file and tried to traverse through
the DOM tree. I used Document.getNodeValue() method and
Document.getTextContent() method to access the text values values of the
nodes and getNodeValue() gave "null" values to the nodes, but
getTextContent() gave correct values in the XML itself. Can someone explain
me the difference between these two methods?

This is the XML file I was using :

<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Thiwanka</to>
<from>Erangi</from>
</note>

Thanks.

-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<thiwas@ymail.com>

Mime
View raw message