I'm creating the XML for my RSS feed programatically in PHP.
It's all good except for one thing - I can't create the <atom:link>
element correctly.
With any other element, this works:
$channel->addChild('title', "My Blog");
But when I try this...
$channel->addChild('atom:link');
...it creates a <link>
element and not the expected <atom:link>
. I've tried adding the atom
part as a namespace but that just creates <link xlmns='atom'>
instead.
How can I do this?
You can pass a third parameter as the namespace where atom:link is available.
$root->addChild('atom:link','','http://www.w3.org/2005/Atom');