You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Lynn Monson <lm...@flipdog.com> on 2001/01/10 01:09:39 UTC

Question re: CharacterDataImpl nodes

I've come across a situation with nodes descending from CharacterDataImpl
that might be a Xerces (1.x?) bug depending on DOM spec interpretation.
Before fixing it though, I'd like to double check my interpretation.

Scenario:
Suppose I create a text node as follows:
  Text t = doc.createTextNode( null );

This call works, presumably because DOM says that createTextNode() throws no
exceptions.  But what is the result of "t.getNodeValue()"?  Xerces currently
returns null, but I wonder if it ought not be an empty string.

The same scenario holds for comments, PIs, and CDATA; when created with a
null as their text content, should their getNodeValue() methods return an
empty string?  It wasn't clear to me from the DOM spec what the right answer
ought to be, but perhaps I overlooked something.