I require to generate xml of the following format.
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">[{"Name":"Sachin","AGE":"35","SALARY":52396.80,"MARGIN":-0.11},{"Name":"Kumar","AGE":"32","SALARY":55700,"MARGIN":0.21}, {"Name":"Singh","AGE":"25","SALARY":20000,"MARGIN":0.15}]
</string>
Following code in PHP, We are using to generate this xml dynamically.
$xml = new SimpleXMLElement('<string/>');
$track = $xml->addChild('track', $JSONSTRING);
Header('Content-type: text/xml');
print($xml->asXML());
But the JSON string is not coming as a node value.
Please suggest the correct code.
4