# Text with \\n OK from String notOK from XML

**URL:** <https://forum.kirupa.com/t/text-with-n-ok-from-string-notok-from-xml/240490>\
**Category:** Uncategorized\
**Created:** [October 3, 2007, 1:59pm UTC](https://forum.kirupa.com/t/text-with-n-ok-from-string-notok-from-xml/240490 "2007-10-03T13:59:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![giovapaglia](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@giovapaglia](https://forum.kirupa.com/u/giovapaglia)\
**Post date:** [October 3, 2007, 1:59pm UTC](https://forum.kirupa.com/t/text-with-n-ok-from-string-notok-from-xml/240490/1 "2007-10-03T13:59:34Z")

</div>

If I assign to a TextField  
a normal string containing newline backslash escape sequences  
it works…  
i.e. it shows exactly more than one line of text…  
If I assign to a TextField  
a string taken from an XML element  
it doesn’t work  
i.e. it doesn’t shows more than one line…  
and it still shows newline backslash escape sequences.

Tracing of both strings is exactly the same!  
:h:

Is there anybody that can explain this behavior?  
Or that can suggest me a way to bypass the problem…

this works:

```auto
var s:String = "text containing newline backslash escape 
continue after newline 
and after";
textfield.text = s;

```

and visualize this:

```auto
text containing newline backslash escape 
continue after newline 
and after

```

if reading from an xml element:

```auto
<anxmlelement>text containing newline backslash escape 
continue after newline 
and after</anxmlelement>

```

this doesn’t work:

```auto
var s:String = MainXML.anxmlelement.toString();
textfield.text = s;

```

and visualize this:

```auto
text containing newline backslash escape 
continue after newline 
and after

```

Thanks for any help  
Jo
