nodeValue vs. textContent

Y

yawnmoth

What's the difference between the DOMNode proprties of nodeValue and
textContent?
 
J

Joseph Kesselman

yawnmoth said:
What's the difference between the DOMNode proprties of nodeValue and
textContent?

Node Value is the value of a single node and its descendants.

Text Content is part of the XPath support. The XPath concept of a text
node doesn't reflect the fact that the DOM may break up adjacent text
into multiple Text and CDataSection and EntityReference nodes, so to
retrieve the content of the "XPath Text Node" we may have to gather data
from following siblings as well as the node this operation is actually
called on.

See the DOM Recommendation, particularly the discussion of XPath
support, for more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top