- Joined
- Jun 23, 2010
- Messages
- 2,323
- Reaction score
- 2,195
$file = new FileSystem('./scripts_config_new.xml');
$wotfile = new WOTXMLFile($file);
$wotps = new WOTPacketSection($wotfile);
$xmloutput = $wotfile->ExportToXML($wotps, 'scripts_config')->OutputMemory();
echo htmlspecialchars($xmloutput);
$newfile = new FileSystem('./scripts_config_new.xml', true);
$newwotfile = new WOTXMLFile($newfile, WOTPacketSection::HEADER);
$newwotps = new WOTPacketSection($newwotfile);
// Arguments: WOTPacketSection, XML, remove roottag
$newwotfile->ImportFromXML($newwotps, '', true);
Not bad, but aren't you supposed to set the content-type to text/xml or application/xml instead of text/html?