#910 DOM nodes with null nodeValue

v9.1
closed
Michael Kay
5
2012-10-08
2008-12-23
Michael Kay
No

It is possible for the nodeValue() of a DOM node to be null (for example, the value of a text node can be set to null using text.setData(null). The Saxon DOM interface does not allow for this possibility, and may therefore crash with a NullPointerException when this happens.

A patch is being raised (9.1 branch, module net.sf.saxon.dom.NodeWrapper) than detects this situation and returns a zero length string instead.

Also Navigator.copy() is being patched so that if the string value of a text node is zero length, no event is sent to the receiver. This reflects the fact that XDM text nodes should never be zero-length. Ideally Saxon would ignore zero-length DOM text nodes entirely, but in practice this is difficult to achieve.

Discussion

  • Michael Kay
    Michael Kay
    2008-12-23

    Note that this affects 9.1 and all previous releases.

     
  • Michael Kay
    Michael Kay
    2009-03-17

    Fixed in 9.1.0.6