dom4j

How to get element's raw value without trimming it using dom4j?


Imagine that I have the following XML element with multi-lines value \nline2,

<address>
line2</address>

I'm using dom4j Element's getText(), but it trimmed the empty line (the \n) and returned line2.

Is there a way to retrieve the raw value \nline2 without trimming?


Solution

  • I doubt that. You probably used getTextTrim().