# Help on xml file

**URL:** <https://forum.kirupa.com/t/help-on-xml-file/185873>\
**Category:** Uncategorized\
**Created:** [April 17, 2006, 9:00am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873 "2006-04-17T09:00:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosmicloverocks](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cosmicloverocks](https://forum.kirupa.com/u/cosmicloverocks)\
**Post date:** [April 17, 2006, 9:00am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/1 "2006-04-17T09:00:54Z")

</div>

let say i have this on my xml file  
\<title\>name age height\</title\>

but on flash file i want them to display like this

name  
age  
height

on new line each

---

<div class="post-metadata">

**Author:** ![955](https://avatars.discourse-cdn.com/v4/letter/9/4bbf92/32.png) [@955](https://forum.kirupa.com/u/955)\
**Post date:** [April 17, 2006, 9:39am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/2 "2006-04-17T09:39:51Z")

</div>

What’s the point in using XML if you’re going to separate different pieces of data with a space? :lol:

But nevertheless… try String.split(" “).join(”  
")

---

<div class="post-metadata">

**Author:** ![cosmicloverocks](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cosmicloverocks](https://forum.kirupa.com/u/cosmicloverocks)\
**Post date:** [April 17, 2006, 9:50am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/3 "2006-04-17T09:50:18Z")

</div>

how exactlly …

---

<div class="post-metadata">

**Author:** ![955](https://avatars.discourse-cdn.com/v4/letter/9/4bbf92/32.png) [@955](https://forum.kirupa.com/u/955)\
**Post date:** [April 17, 2006, 9:55am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/4 "2006-04-17T09:55:12Z")

</div>

Well, I assume you’ve already loaded the XML file. Then, if you do xml.firstChild.firstChild.nodeValue.split(" “).join(”  
") then you should get the contents of the node with all spaces replaced with newlines.

---

<div class="post-metadata">

**Author:** ![cosmicloverocks](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cosmicloverocks](https://forum.kirupa.com/u/cosmicloverocks)\
**Post date:** [April 17, 2006, 11:36am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/5 "2006-04-17T11:36:14Z")

</div>

```auto
root.childNodes[2].childNodes.split(" ").join("
") 

```

i did this and giving me undefine

---

<div class="post-metadata">

**Author:** ![cosmicloverocks](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@cosmicloverocks](https://forum.kirupa.com/u/cosmicloverocks)\
**Post date:** [April 17, 2006, 11:36am UTC](https://forum.kirupa.com/t/help-on-xml-file/185873/6 "2006-04-17T11:36:56Z")

</div>

the root is not the \_root it just a referenct to the root of xml file
