Problems parsing XML, how to get around newlines?

Hello

Hope nobody is angry with me posting this problem here... I'm working on a MIDP project, even if this problem isn't exactly a midp problem...

Ok if I try to read in:

I replaced the whitespaces with _ because of the forum

_<ims:p>Read the following question and indicate your agreement on a

_scale of 1 = strongly disagree to 5 = strongly agree.</ims:p>

I get the newline too in my parser. The whitespaces I remove with trim() (better solutions?)

But how to remove the new line?

What I get parsing it is:

Read the following question and indicate your agreement on a

_scale of 1 = strongly disagree to 5 = strongly agree.

thanks

Jossi

[731 byte] By [Jossnaza] at [2007-10-3 4:59:28]
# 1

There is no geniric function

by the way you can convert xml string into char array and then see for whitespace characters ///copy only non newline chars into new array

public boolean isWhite(char ch){

if(ch==' ' || ch=='\u0009' || ch == '\n' ||ch=='\u000B'

|| ch=='\u000C'

){

return true;

}

return false;

}

modify according to your code

sailesh_dita at 2007-7-14 23:04:54 > top of Java-index,Java Mobility Forums,Java ME Technologies...