XML string with return sign

I put back in a XML file a string with many lines.
But after record it I have only one lines.

txt.setContent(t.getTxt()); //txt is my xml node

What is missing ?

What is t again?


t is one of the object which with this function return a string.
I have no errors except the txt indent uncorrect

Did you write this function? Then insert "\n"

I can’t help you with that.

I tried to modificate the getTxt() function like this :

 String getTxt() {
        String t[] = txt.split("\n");
        String t2[] = new String[t.length];
        String ft = "";
        for (int i=0; i<t.length; i++) {
            t2[i] =  trim(t[i]);
            ft += t2[i];
        return ft;

But he forget always to write the ("\n") sign the xml.
I think this function is useless.

you don’t provide enough context

Did you try


after String t[] = txt.split("\n"); ?

Maybe t[] is empty?