[XAseco] xmlparser not working properly

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
malun22
pedestrian
pedestrian
Posts: 12
Joined: 19 Jul 2019 12:04
Owned TM-games: TMNF

[XAseco] xmlparser not working properly

Post by malun22 » 04 Oct 2019 00:11

Hi, I decided to respecify the problem of the XML parser from aseco, cuz it was stupid to think someone would click on that pasetbin link before.

Example of the xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GDB>
     <SETTINGS>
	     <ENABLE_REQUESTS>true</ENABLE_REQUESTS>
	     <SHOW_BUTTON>true</SHOW_BUTTON>
     </SETTINGS>
     <REQUESTS>
	     <REQUEST>
		     <LOGIN>dummy</LOGIN>
		     <UID>donotdelete</UID>
	     </REQUEST>
	</REQUESTS>
</GDB>
Here's the thing: When reading the above xml with:

Code: Select all

$array = $aseco->parseXML(blabla.xml);
Everythings fine. But when immediatly again parsing the received array to an XML like this:

Code: Select all

$xmlstring = $aseco->parseArray($array);
file_put_contents("blabla.xml", $xmlstring);
it loses the overall <GDB></GDB> element and shows this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <SETTINGS>
	     <ENABLE_REQUESTS>true</ENABLE_REQUESTS>
	     <SHOW_BUTTON>true</SHOW_BUTTON>
     </SETTINGS>
     <REQUESTS>
	     <REQUEST>
		     <LOGIN>dummy</LOGIN>
		     <UID>donotdelete</UID>
	     </REQUEST>
</REQUESTS>
Would be awesome if somebody could figure out why it's happening, or if it's my fault, tell me what I am doing wrong.
Last edited by Xymph on 04 Oct 2019 07:07, edited 1 time in total.
Reason: Use code tags for code, logs, etc

Post Reply