foreach($attachments as $attachment){
$enclosure=$attachment->getEnclosure();
if ($enclosure) {
- // DO NOT move xmlns declaration to root element. Making it
- // the default namespace here improves compatibility with
- // real-world feed readers.
- $attribs = array(
- 'rdf:resource' => $enclosure->url,
- 'url' => $enclosure->url,
- 'xmlns' => 'http://purl.oclc.org/net/rss_2.0/enc#'
- );
+ $attribs = array('rdf:resource' => $enclosure->url);
if ($enclosure->title) {
$attribs['dc:title'] = $enclosure->title;
}
$attribs['dc:date'] = common_date_w3dtf($enclosure->modified);
}
if ($enclosure->size) {
- $attribs['length'] = $enclosure->size;
+ $attribs['enc:length'] = $enclosure->size;
}
if ($enclosure->mimetype) {
- $attribs['type'] = $enclosure->mimetype;
+ $attribs['enc:type'] = $enclosure->mimetype;
}
- $this->element('enclosure', $attribs);
+ $this->element('enc:enclosure', $attribs);
}
$this->element('sioc:links_to', array('rdf:resource'=>$attachment->url));
}
'http://commontag.org/ns#',
'xmlns:foaf' =>
'http://xmlns.com/foaf/0.1/',
+ 'xmlns:enc' =>
+ 'http://purl.oclc.org/net/rss_2.0/enc#',
'xmlns:sioc' =>
'http://rdfs.org/sioc/ns#',
'xmlns:sioct' =>