Welcome Guest, Not a member yet? Register   Sign In
Creating file .xml from rss?
#7

[eluser]Bas Vermeulen[/eluser]
Oh you want the output to be XML?

Put this in your view, should work:
Code:
header("Content-Type: text/xml;charset=UTF-8");
    $sitemap = '<?xml version="1.0" encoding="UTF-8"?>
            <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
                    >
                <url>
                <loc>www.domain.tld/page</loc>
                <lastmod>2010-09-06</lastmod>
                <changefreq>daily</changefreq>
                <priority>0.8</priority>
                </url>
            </urlset>';
    echo $sitemap;

Your feed controller should pull the data from a model and send it to the view, in the view you can then populate the xml feed with a simple foreach looping through your data array.

I hope this does answer your question?


Messages In This Thread
Creating file .xml from rss? - by El Forum - 09-05-2010, 02:23 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 03:20 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 03:43 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 03:56 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 04:09 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 04:29 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 04:46 PM
Creating file .xml from rss? - by El Forum - 09-05-2010, 05:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB