Change XML Format in playlist.xml

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
gazzer82
Blank Cone
Blank Cone
Posts: 23
Joined: 20 Mar 2006 19:44

Change XML Format in playlist.xml

Postby gazzer82 » 10 Apr 2006 20:50

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 10 Apr 2006 22:52

The first XML example looks perfectly valid to me. Does flash provide some error message explaining the error ?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

gazzer82
Blank Cone
Blank Cone
Posts: 23
Joined: 20 Mar 2006 19:44

Postby gazzer82 » 11 Apr 2006 13:07

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 11 Apr 2006 14:48

You could just edit the http/requests/playlist.xml file to add another parent xml node.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

gazzer82
Blank Cone
Blank Cone
Posts: 23
Joined: 20 Mar 2006 19:44

Postby gazzer82 » 11 Apr 2006 21:40

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 11 Apr 2006 22:26

Add the opening node on line 26 and the closing node at the end of the file.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 19 guests