You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2005/01/06 16:00:25 UTC

Adding text inside elements using JAXP

Hi Lenya devs,

it is not possible to add text to an element using the
setNodeValue() method. This method sets the DOM node value
of a node, which in case of an element is always null.

You can use the o.a.l.xml.DocumentHelper.setSimpleElementText()
method instead.


Wrong:
   element.setNodeValue("Summary");

Correct:
   DocumentHelper.setSimpleElementText(element, "Summary");


-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org