Jump to content


Photo

Why might this addtional XML code stop page from loading?


  • Please log in to reply
8 replies to this topic

#1 hexcode

hexcode

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 July 2014 - 02:44 PM

<?xml-stylesheet href="/player.xsl" type="text/xsl"?>

<config>
  <auto_start>false</auto_start>
  <player_skin>/test.swf</player_skin>
  <main_title>Test</main_title>
  <playlist_title>PLAYLIST</playlist_title>
  <time_text>TOTAL TIME</time_text>
  <pan_labels>L,R</pan_labels>
  <scroller_speed>1</scroller_speed>	
  <scroller_marquee_content>#TRACK_NAME#</scroller_marquee_content>
  <repeat_is_enabled>false</repeat_is_enabled>
  <shuffle_is_enabled>false</shuffle_is_enabled>
  <default_volume>75</default_volume>
  <default_pan>0</default_pan>
	<play_list>
		<item>test.mp3;Test Soundtrack</item>
	</play_list>
</config>

Hi,

 

The above code is from an XML file and I added the <?xml line of code to the XML file, but doing so causes the whole page to no longer display the track information (just blank).

Is there there a way I could modify that text to try and call it another way?

 

Thanks


Edited by hexcode, 16 July 2014 - 02:52 PM.


#2 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,025 posts
  • LocationWA

Posted 16 July 2014 - 04:01 PM

Looking at your other thread, this XML is going to a Flash player right? So what "page" is going blank?

Is it the page where you try to load this XML in your browser directly? Do you, in fact, have a /player.xsl that will transform the XML into something readable?

Edited by requinix, 16 July 2014 - 04:01 PM.


#3 hexcode

hexcode

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 July 2014 - 04:31 PM

Hi,

 

Yes, it is. Just the music player's playlist is blank (which mean the XML file is not loading) when I add the additional <?xml tag to the top.

The purpose of the .xsl tag is to now allow the xml page to be viewable if you use its url address.

 

Part of the XSL file has: <meta http-equiv="refresh" content="0; url=http://www.mywebsite...e.com/"></meta>



#4 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,025 posts
  • LocationWA

Posted 16 July 2014 - 06:30 PM

Then it seems like the player doesn't like the <?xml-stylesheet?> instruction.

I'd say leave it out. Really, what's the harm in people looking at the XML? It's not like you can hide it from them anyways, and neither are you linking to it for a person to check...

#5 hexcode

hexcode

    Member

  • Members
  • PipPip
  • 10 posts

Posted 16 July 2014 - 06:42 PM

That's true I guess. It just used to work of my previous music player so I was wondering why it was not working with this newer music player.



#6 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,025 posts
  • LocationWA

Posted 16 July 2014 - 08:40 PM

So I found the player and had it decompiled. The part where it deals with the config XML looks like
if (_root.xml != undefined) {
	_xml.load(_root.xml);
} else {
	_xml.load("config.xml");
}
_xml.onload = function (success) {
	var _local3 = 0;
	while (_local3 < this.firstchild.childnodes.length) {
		if (this.firstchild.childnodes[_local3].nodetype == 1) {
			if (this.firstchild.childnodes[_local3].nodename != "play_list") {
				o[this.firstchild.childnodes[_local3].nodename] = this.firstchild.childnodes[_local3].firstchild.nodevalue;
			} else {
				o[this.firstchild.childnodes[_local3].nodename] = new array();
				var _local4 = 0;
				while (_local4 < this.firstchild.childnodes[_local3].childnodes.length) {
					if (this.firstchild.childnodes[_local3].childnodes[_local4].nodetype == 1) {
						o[this.firstchild.childnodes[_local3].nodename].push(this.firstchild.childnodes[_local3].childnodes[_local4].firstchild.nodevalue);
					}
					_local4++;
				}
			}
		}
		_local3++;
	}
The part where it deals with "this.firstchild" is where it fails: by inserting the processing block, the first child is no longer the <config> and the code starts to fall apart.

tl;dr: the player reads the XML poorly.

#7 hexcode

hexcode

    Member

  • Members
  • PipPip
  • 10 posts

Posted 17 July 2014 - 03:22 AM

Thank you for finding the reason out. Kind of had a feeling that line was causing the rest of the config.xml file to not load.

 

Just wondering, are you experienced with Flash coding/modifying? There are three of four changes I need done to the player to make it work for me.

I wanted to know if you could or would be interested in help me making them (although I'm very basic with flash) or might consider looking into making them (I have all the raw files I could send you)?



#8 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,025 posts
  • LocationWA

Posted 17 July 2014 - 04:53 PM

No experience at all. It's just that reading code is easier than writing it.

You may be able to get away with putting the <?xml-stylesheet?> at the end of the file, after the closing </config>. In general the placement shouldn't matter.

#9 hexcode

hexcode

    Member

  • Members
  • PipPip
  • 10 posts

Posted 20 July 2014 - 11:13 AM

No such luck. Adding that closing tag didn't help. Thanks though.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com