# How to represent break line in xml?

**URL:** https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698
**Category:** Uncategorized
**Created:** [March 1, 2003, 5:24pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698 "2003-03-01T17:24:52Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![eudora](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@eudora](https://forum.kirupa.com/u/eudora)
#### Post date: [March 1, 2003, 5:24pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/1 "2003-03-01T17:24:52Z")

</div>

if i get the infomation from an xml file and display it in a textfield…  
how can i represent a breakline in the xml file so that the textfield also have a new line?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 1, 2003, 5:36pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/2 "2003-03-01T17:36:00Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 1, 2003, 5:45pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/3 "2003-03-01T17:45:49Z")

</div>

```php

<event title="Finally" description="test1" + "
" + "test2" />

```

lets say this is the code  
is this correct?  
will the textfield show a newline?

[edited]  
just a note that is part of a code from the xml file which i want the textfield to get information from  
will the description appears as i want?  
eg  
test1  
test2

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 1, 2003, 6:53pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/4 "2003-03-01T18:53:20Z")

</div>

hmmz am i rite to say that xml wont allow me to do that?  
cos i manage to get round this only by recoding the AS and the structure the XML file is…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 1, 2003, 7:44pm UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/5 "2003-03-01T19:44:17Z")

</div>

just

\<\*\*event title=“Finally” description=“test1  
test2” /\>

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 2:16am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/6 "2003-03-02T02:16:38Z")

</div>

senocular: this is not working

here is my xml file codes

```php

<events startDate="2003-01-01" endDate="2004-12-31">

	<event title="Test Event 1" description="once on 10 february" startDate="2003-02-10 17:30:00" endDate="2003-02-10 19:30:00" allDay="0" eventType="once" />
	
</events>

```

here is my AS to display it in a textfield called events\_txt

```php

calendar_mc.onDisplayEvent = function (eventsData,dateObj) {
          var output_str;
          var c = events_txt;
          c.htmlText = "";
          for (var i=0; i<eventsData.length; i++) {
	output_str += + dateObj+ "
";
	output_str += eventsData*.title + "
";
	output_str += eventsData*.description + "

";	
          }
          c.htmlText += output_str;
}

```

when i use what u tell me  
description=“test1  
test2”  
it doesnt show it as  
test1  
test2  
but it is shown as test1  
test2

or am i still doing something wrong?  
i edited the xml file to give description childNodes to have different paragraphs then edit the AS to detect the number of childNodes and show the paragraphs respectively…

u can go to  
[http://slog.nisausdx.net/blog.swf](http://slog.nisausdx.net/blog.swf)  
to see the feb 28 entry to see what i want…

oh… thanks for the help! If there is something that i could have done instead please let me know… 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 2:40am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/7 "2003-03-02T02:40:39Z")

</div>

if you are using HTML text, use \<\*\*br\> instead

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 2:45am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/8 "2003-03-02T02:45:12Z")

</div>

like this  
description=“test1\<-br-\>test2”

or

description=“test1” + \<-br-\> + “test2”

i tried both method and it is not working  
wont even load the xml file properly

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 3:50am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/9 "2003-03-02T03:50:03Z")

</div>

well since you’re doing it from within an xml attribute, youd use this

&\*\*lt;br&\*\*gt;

otherwise the tags will screw with the xml formatting.

where were the \<- and -\> coming from?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 3:59am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/10 "2003-03-02T03:59:03Z")

</div>

oh the \<- and -\> is because i dun want to use the php codes…  
hehe it is br without the -'s

wat is lt,br and gt?

br is break?  
lt? line terminate?

oh and is it possible to make bold words in xml attributes?  
where can i find more of such codes?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 2, 2003, 5:13am UTC](https://forum.kirupa.com/t/how-to-represent-break-line-in-xml/14698/11 "2003-03-02T05:13:25Z")

</div>

&\*\*lt; and &\*\*gt; are html for Less Than (lt) and Greater Than (gt) just like a hard nonbreaking space &\*\*nbsp;  
&\*\*lt;br&\*\*gt; is just \<\*\*br\> without messing with the xml
