<?php
// Start XML file, create parent node
$doc = new DOMDocument();
$doc->formatOutput = true;
$node = $doc->createElement("rootnode");
$parnode = $doc->appendChild($node);
$node = $doc->createElement("childnode");
$newnode = $parnode->appendChild($node);
$newnode->setAttribute("description", "Some Description Text");
$xmlfile = $doc->saveXML();
header("Content-type: text/xml");
echo $xmlfile;
?>
No comments:
Post a Comment