Discussion board

How to add a guide tag

?
06-04-2013

AL

Hello, I have set up an ARA script to create an RSS feed that is not written to any site to feed it. I am trying to add the <guid isPermaLink = "false"> foo </guid> tag to <item>, but I cannot correctly create an xml file when this code changes: ara-class.php file:
 public function ARAItem( $title, $link, $desc, $date)
    {
    $item = $this->doc->createElement("item");
    $item->appendChild($this->ARAMakeTag("title", $title)); 
    $item->appendChild($this->ARAMakeTag("link", "example.com"));
  $item->appendChild($this->ARAMakeTag("guid", uniqid('', true)));
    $item->appendChild($this->ARAMakeTag("description", $desc)); 
    $item->appendChild($this->ARAMakeTag("pubDate", $date));
    $this->channel->appendChild($item);
The returned guid tag is <guid> 51643984aa563.72d </guid> which is clearly not standard. Do you have a lead? Thanking you in advance. Friendly, "Al"
06-04-2013

webmaster

Hi. The AREMakeTag function accepts two parameters - the tag name and its contents. You can add other elements to the element, but without going through this function. For example, in the ARAItem function:
$tag = $this->doc->createElement("guid");
$tag->appendChild( $this->doc->createTextNode("foo"));
$tag->setAttribute("isPermaLink", "false");
$item->appendChild($tag);
I haven't tested this code, but it seems to match what you want to do. Warmly
07-04-2013

AL

Hello, that was exactly what I was looking for. Thanks very much. Have a great Sunday, "El"