Corrections sur le flux pour validation

This commit is contained in:
echarp 2014-06-27 11:00:59 +02:00
parent 6e152f0d43
commit 6406c4b1d0

View File

@ -1,6 +1,6 @@
xml.instruct! xml.instruct!
xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", xml.rdf :RDF, 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
'xmlns' => "http://purl.org/rss/1.0/", 'xmlns:dc' => "http://purl.org/dc/elements/1.1/", 'xmlns' => "http://purl.org/rss/1.0/", 'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
'xmlns:sy' => "http://purl.org/rss/1.0/modules/syndication/", 'xmlns:sy' => "http://purl.org/rss/1.0/modules/syndication/",
'xmlns:admin' => "http://webns.net/mvcb/", 'xmlns:cc' => "http://web.resource.org/cc/", 'xmlns:admin' => "http://webns.net/mvcb/", 'xmlns:cc' => "http://web.resource.org/cc/",
@ -14,9 +14,9 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml.dc :creator, 'AgendaDuLibre.org' xml.dc :creator, 'AgendaDuLibre.org'
xml.items do xml.items do
xml.tag! 'rdf:Seq' do xml.rdf :Seq do
for event in @events for event in @events
xml.tag! 'rdf:li', 'rdf:resource' => event_url(event) xml.rdf :li, 'rdf:resource' => event_url(event)
end end
end end
end end
@ -28,13 +28,13 @@ xml.tag! 'rdf:RDF', 'xmlns:rdf' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml.link event_url event xml.link event_url event
xml.dc :identifier, "#{event.id}@agendadulibre.org" xml.dc :identifier, "#{event.id}@agendadulibre.org"
xml.dc :date, event.start_time.iso8601 xml.dc :date, event.start_time.iso8601
xml.dc :point, "#{event.related_city.latitude} #{event.related_city.longitude}" rescue nil xml.georss :point, "#{event.related_city.latitude} #{event.related_city.longitude}" rescue nil
@event = event @event = event
content = render file: '/events/show.html', locals: { rss: true } content = render file: '/events/show.html', locals: { rss: true }
xml.description strip_tags(content) xml.description strip_tags content
xml.tag!('content:encoded') { xml.cdata!(content) } xml.content(:encoded) { xml.cdata! content }
end end
end end
end end