FSX30HD Posted February 21, 2015 Report Posted February 21, 2015 Hello everybody, Now I work to a new ACARS MAP, so I need to know where the xml file is,to parse it. Have you an idea please ? Quote
t_bergman Posted February 23, 2015 Report Posted February 23, 2015 phpVMS's acars map draws from the database and not from an xml file. Quote
FSX30HD Posted February 23, 2015 Author Report Posted February 23, 2015 phpVMS's acars map draws from the database and not from an xml file. Thanks for your reply, the map draws from json format and the link is: /action.php/acars/data I have found howto output in xml format. I have just make a php file echo rows in xml format. But maybe in ACARS module instead of use json_encode switch to saveXML() like this: //Creates XML string and XML document using the DOM $dom = new DomDocument('1.0', 'UTF-8'); //add root == jukebox $jukebox = $dom->appendChild($dom->createElement('jukebox')); for ($i = 0; $i < count($arrayWithTracks); $i++) { //add track element to jukebox $track = $dom->createElement('track'); $jukebox->appendChild($track); // Appending attributes to track $attr = $dom->createAttribute('source'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['source'])); $track->appendChild($attr); $attr = $dom->createAttribute('artist'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['artist'])); $track->appendChild($attr); $attr = $dom->createAttribute('album'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['album'])); $track->appendChild($attr); $attr = $dom->createAttribute('title'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['title'])); $track->appendChild($attr); } $dom->formatOutput = true; // set the formatOutput attribute of domDocument to true // save XML as string or file $test1 = $dom->saveXML(); // put string in test1 $dom->save('test1.xml'); // save as file Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.