php svg write to xml file [Archive] - XML Elves

php svg write to xml file

ab
06-25-2005, 08:03 AM
hi every one

i am trying to write data to xml file , the following code allowing doing that but the writting to the file will be copied twice , after testing the code several times i have noticed that when i remove the svg elements from the code below this allows writting to the file the data i wanted (not twice )

how can i keep svg elements in the following code with writting the data normally


thanks










<?php

header&#40;"Content-type&#58; image/svg+xml"&#41;;
print&#40;'<?xml version="1.0" encoding="iso-8859-1"?>'&#41;;
print&#40;'<svg width="300" height="300" viewBox="0 0 300 300">'&#41;;
print&#40;'<text x="50" y="60">fff</text>'&#41;;


print&#40;'</svg>'&#41;;


include &#40;'Driving-Test.php'&#41;;
$xml = simplexml_load_string&#40;$xmlstr&#41;;
$result = $xml->xpath&#40;"//answer"&#41;;

$file_handle = fopen&#40;'R.xml','a'&#41;;
$content = '<?xml version="1.0"?>
<results>';
foreach &#40;$result as $row&#41;
&#123;
$content.="\n<result>".$row->mark."</result>\n";
&#125;
$content .="</results>";
fwrite&#40;$file_handle,$content&#41;;
fclose&#40;$file_handle&#41;;
?>

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum