Page 1 of 1

Change XML Format in playlist.xml

Posted: 10 Apr 2006 20:50
by gazzer82
Hi all,

I am having some issuse parsing the xml from the playlist.xml file into a flash application. Currently the file produced looks something like this

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<node id="1" name="Undefined" ro="rw" >

<node id="3" name="General" ro="ro" >

<leaf id="4" uri="C:\Documents and Settings\Gareth\My Documents\Downloads\02gnarls.mp3" name="C:\Documents and Settings\Gareth\My Documents\Downloads\02gnarls.mp3" ro="rw" duration="-1" />

<leaf id="5" uri="C:\Ashley Long & Paris.wmv" name="Ashley Long & Paris" ro="rw" duration="1018999000" />

<leaf id="6" current="current" uri="C:\NowThatsaStereo.mpg" name="C:\NowThatsaStereo.mpg" ro="rw" duration="15406664" />

</node>

</node>


Now flash just will not read this file, the only way i can make it work is by manually changing a static playlist.xml file to look like this.

<nodes>
<node id="1" name="Undefined" ro="rw" ></node>
<node id="3" name="General" ro="ro" >
<leaf id="4" uri="C:\Documents and Settings\Gareth\My Documents\Downloads\02gnarls.mp3" name="C:\Documents and Settings\Gareth\My Documents\Downloads\02gnarls.mp3" ro="rw" duration="-1" />
<leaf id="5" uri="C:\Ashley Long & Paris.wmv" name="Ashley Long & Paris" ro="rw" duration="1018999000" />
<leaf id="6" current="current" uri="C:\NowThatsaStereo.mpg" name="C:\NowThatsaStereo.mpg" ro="rw" duration="15406664" />
</node>
</nodes>


I know this isn't strictly the correct format, but the actual name of the playlist isn't relivant for me, i can just ignore the first result. So can anyone guide me to what i would need to change within the vlc web files to produce the fiel dynamically, it seems to be a case of just adding a new </node> tag, but no matter where i try to add it i end up with invalid xml.

So can anyone help please!!!

Cheers

Gareth

Posted: 10 Apr 2006 22:52
by dionoea
The first XML example looks perfectly valid to me. Does flash provide some error message explaining the error ?

Posted: 11 Apr 2006 13:07
by gazzer82
Yeah that would be handy wouldn't it, but the error reporting cosists or ot just not poulating the array with data. I really do think the xml support in flash was very much levered in at the last minute, cause it truly sucks!!

So any ideas on how i would change this to make it work, i will give it one more go with the correct xml, but i have been at this for over a week with no success.

Cheers

Gareth

Posted: 11 Apr 2006 14:48
by dionoea
You could just edit the http/requests/playlist.xml file to add another parent xml node.

Posted: 11 Apr 2006 21:40
by gazzer82
Yeah, thats what i have been trying to do for a few days, where about in the file would the <node> tag need to go? Everywhere i have trie dit so far i invalidate the xml. Doh!!

So any help would be greatly appreciated!!

Cheers

Gareth

Posted: 11 Apr 2006 22:26
by dionoea
Add the opening node on line 26 and the closing node at the end of the file.