PDA

View Full Version : help on xml file



cosmicloverocks
April 17th, 2006, 05:00 AM
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

λ
April 17th, 2006, 05:39 AM
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("\n")

cosmicloverocks
April 17th, 2006, 05:50 AM
how exactlly ...

λ
April 17th, 2006, 05:55 AM
Well, I assume you've already loaded the XML file. Then, if you do xml.firstChild.firstChild.nodeValue.split(" ").join("\n") then you should get the contents of the node with all spaces replaced with newlines.

cosmicloverocks
April 17th, 2006, 07:36 AM
root.childNodes[2].childNodes.split(" ").join("\n")

i did this and giving me undefine

cosmicloverocks
April 17th, 2006, 07:36 AM
the root is not the _root it just a referenct to the root of xml file