Hello,
I am trying to create an rss feed using php dom. I have created regular xml files before... but I am running into a problem with proper nesting for the rss feed.
here is what I have so far:
<?php
//create doctype
$dom = new DOMDocument("1.0");
//display document in browser as plain text
//for readability purposes
header("Content-Type: text/plain");
//create root element
$root = $dom->createElement("rss");
$dom->appendChild($root);
//create attribute for pep
$version = $dom->createAttribute("version");
$root->appendChild($version);
//create attribute value for pep
$versionValue = $dom->createTextNode("2.0");
$version->appendChild($versionValue);
//create channel with in rss
$channel = $dom->createElement("channel");
$root->appendChild($channel);
//create channel with in rss
$title1 = $dom->createElement("title");
$root->appendChild($title1);
//create text node
$textTitle = $dom->createTextNode("Sono-Tek Corporation News");
$title1->appendChild($textTitle);
//create channel with in rss
$link1 = $dom->createElement("link");
$root->appendChild($link1);
//save and display tree
echo $dom->saveXML();
?>
if anyone knows of any tutorials that use DOM to create RSS feeds let me know. The ones I have found so far are just for regular xml...
Thanks for the help.