'/rss/channel/title | /rdf:RDF/rss10:channel/rss10:title | //atom03:feed/atom03:title | //atom10:feed/atom10:title', 'description' => '/rss/channel/description | /rdf:RDF/rss10:channel/rss10:description | //atom03:feed/atom03:tagline | //atom10:feed/atom10:subtitle', 'link' => '/rss/channel/link | /rdf:RDF/rss10:channel/rss10:link | //atom03:feed/atom03:link | //atom10:feed/atom10:link', 'copyright' => '/rss/channel/copyright | /rdf:RDF/rss10:channel/rss10:copyright | //atom03:feed/atom03:copyright | //atom10:feed/atom10:copyright' ); /** * Construct form parameters for each replacement parameter available. */ function additionalFormParameters() { foreach ($this->replacements as $key => $path) { ?>


replacements as $key => $path) { // Query and process the nodes slated for replacement. $nodes = $xpath->query($path); foreach ($nodes as $node) { // Process this replacement if the key exists as a parameter. if (isset($_GET[$key]) && $_GET[$key]) { // Clear out all children of the container. $this->clearNode($node); // Create a new child text node with parameter value. $new_txt = $doc->createTextNode($_GET[$key]); $node->appendChild($new_txt); } elseif (isset($_GET["prefix_$key"]) && $_GET["prefix_$key"]) { $txt_node = $doc->createTextNode($_GET["prefix_$key"]); $node->insertBefore($txt_node, $node->firstChild); } elseif (isset($_GET["suffix_$key"]) && $_GET["suffix_$key"]) { $txt_node = $doc->createTextNode($_GET["suffix_$key"]); $node->appendChild($txt_node); } } } return $doc; } /** * Clear out all the children for a given DOM node. */ function clearNode(&$node) { while ($node->firstChild) { $node->removeChild($node->firstChild); } } } // Instantiate and run the filter only when not being used as an include. if (strpos(basename(__FILE__), basename($_SERVER['SCRIPT_FILENAME'])) !== false) { processFilter(new FeedHeaderFilter()); } ?>