Jump to content

XML path


Recommended Posts

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:


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');
 // Appending attributes to track
 $attr = $dom->createAttribute('source');
 $attr = $dom->createAttribute('artist');
 $attr = $dom->createAttribute('album');
 $attr = $dom->createAttribute('title');
$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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...