Remove whitespace, new line from XML tag text

I am using XMLDecoder to read the following XML input and get an object out of it. If you observe here the value in "<string>" is split into two lines. So when I print this field value from java object it comes as "spouse agency |||||||interact". I would like to get it as one string in one line.

I have tried the method replaceAll("[\\r\\f\\n]","") when reading the input, but it is not helpful. Please help!!!

<object

class="com.package.AgencyInteraction">

<void property="agencyName">

<string>spouse agency

interact</string>

</void>

<void property="completed">

<boolean>true</boolean>

</void>

<void property="interactionType">

<array

class="java.lang.String"

length="1">

<void index="0">

<string>It is

Regulated</string>

</void>

</array>

</void>

</object>

Thanks

[1025 byte] By [Shyamsundera] at [2007-11-27 6:04:12]
# 1
have u tried to form that into a real XML object (e.g. a Document object?)if u do so, it will save u quite a bit of time on doing the searching and replacing process. hope this help
JWKC-5ivea at 2007-7-12 16:48:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Was the xml created using XMLEncoder? If you're not using XMLEncoder there could be other problems when reading it with XMLDecoder.

One option would be to not add those extra line breaks where you generate the xml stream, or just strip them out of the stream before passing it on to the decoder.

cristian.vata at 2007-7-12 16:48:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...