Skip to Content
Former Member
Jun 30, 2006 at 07:17 AM

XML with whitespace over mailadapter - howto delete? JAVA


hello together,

we will receive xml messages over mailadapter. normally the communication partner sends the messages in a good format (no whitespaces between tags). but sometimes it is a bad format like this (caused by outlook preformatting maybe) :





the points '.' will be symbols for blanks or other whitespaces between end-tag of previous node(</tag1.1>) and start-tag(<tag1.2>) of current node in the message. and that is the problem (wrong working of java file).

the difference to a good file:


the internet browser will show it in xml formatted tags with '+' and '-' and if we have a look at the source code we will find a 'good' file.

so my question: how can i delete the whitespaces between closing and opening tags in java? do anybody know a standard java function to handle this problem?

thanks a lot