<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Sorting RSS-feed by date using XSLT</title>
	<atom:link href="http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/feed/" rel="self" type="application/rss+xml" />
	<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/</link>
	<description>In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming.</description>
	<pubDate>Fri, 21 Nov 2008 12:13:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Rozengain.com - New Media Development Blog &#187; Blog Archive &#187; Sorting RSS feeds with XSLT</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-229492</link>
		<dc:creator>Rozengain.com - New Media Development Blog &#187; Blog Archive &#187; Sorting RSS feeds with XSLT</dc:creator>
		<pubDate>Thu, 30 Nov 2000 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-229492</guid>
		<description>[...] I just found this very useful posting on how to sort RSS feeds by date using XSLT. Read it here [...]</description>
		<content:encoded><![CDATA[<p>[...] I just found this very useful posting on how to sort RSS feeds by date using XSLT. Read it here [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmytro Shteflyuk</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-167344</link>
		<dc:creator>Dmytro Shteflyuk</dc:creator>
		<pubDate>Mon, 30 Nov 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-167344</guid>
		<description>Плагин для подсветки синтаксиса -- &lt;a href="http://kpumuk.info/projects/wordpress-plugins/codecolorer/" rel="nofollow"&gt;CodeColorer&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Плагин для подсветки синтаксиса &#8212; <a href="http://kpumuk.info/projects/wordpress-plugins/codecolorer/" rel="nofollow">CodeColorer</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholass</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-167064</link>
		<dc:creator>Nicholass</dc:creator>
		<pubDate>Fri, 30 Nov 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-167064</guid>
		<description>Интересно, а какой у вас плагин подсветки синтаксиса?</description>
		<content:encoded><![CDATA[<p>Интересно, а какой у вас плагин подсветки синтаксиса?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lusever</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-57704</link>
		<dc:creator>lusever</dc:creator>
		<pubDate>Mon, 30 Nov 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-57704</guid>
		<description>Ошибка, не средствами xml, а php.</description>
		<content:encoded><![CDATA[<p>Ошибка, не средствами xml, а php.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lusever</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-57684</link>
		<dc:creator>lusever</dc:creator>
		<pubDate>Sun, 30 Nov 2008 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-57684</guid>
		<description>А как отсортировать rss средствами xml? Загонять все в массив?</description>
		<content:encoded><![CDATA[<p>А как отсортировать rss средствами xml? Загонять все в массив?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-9050</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Fri, 30 Nov 2001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-9050</guid>
		<description>Thanks! This is just what I needed, you saved me a lot of time!</description>
		<content:encoded><![CDATA[<p>Thanks! This is just what I needed, you saved me a lot of time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adamr</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-5007</link>
		<dc:creator>adamr</dc:creator>
		<pubDate>Tue, 30 Nov 2010 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-5007</guid>
		<description>Hi Kpumuk, thanks for your reply. I have spent a long time searching through Google and I agree that PHP seems to be the easiest way to transform XML into HTML for use in a page. I am already using one called CaRP which works quite well. 

In principle though XSLT should be a good way of doing this but perhaps at a higher level than I am trying.....;-)</description>
		<content:encoded><![CDATA[<p>Hi Kpumuk, thanks for your reply. I have spent a long time searching through Google and I agree that PHP seems to be the easiest way to transform XML into HTML for use in a page. I am already using one called CaRP which works quite well. </p>
<p>In principle though XSLT should be a good way of doing this but perhaps at a higher level than I am trying&#8230;..;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kpumuk</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4999</link>
		<dc:creator>Kpumuk</dc:creator>
		<pubDate>Tue, 30 Nov 2004 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4999</guid>
		<description>Hello, adamr 
Thank you for you interest. Of course, you can do all you need using XSLT, but I think this is not so good solution. It will be better to parse XML using native PHP libraries and build result HTML.

1. You can't do this, but... you have ability to transform XML using XSLT with PHP code, just look at &lt;a href="http://ua2.php.net/manual/en/ref.xslt.php" rel="nofollow"&gt;XSLT extension&lt;/a&gt; or &lt;a href="http://ua2.php.net/manual/en/ref.domxml.php" rel="nofollow"&gt;DOM XML extension&lt;/a&gt;. There are many articles in the net about this (just look at &lt;a href="http://www.google.com/search?hl=en&#038;lr=&#038;q=php+transform+xml+with+xslt" rel="nofollow"&gt;Google&lt;/a&gt;

2. To show only lastest of strories you can use something like (XSLT 1.1)
[cc lang="xml"]
&lt;xsl:for-each select="item"&gt;
  &lt;xsl:sort select="pubDate" data-type="dc:date" order="ascending"/&gt;
  &lt;xsl:if test="position() = 1"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:if&gt;
&lt;/xsl:for-each&gt;
[/cc]

instead of

[cc lang="xml"]
&lt;xsl:apply-templates select="item"&gt;
  &lt;xsl:sort select="pubDate" data-type="dc:date" order="ascending"/&gt;
&lt;/xsl:apply-templates&gt;
[/cc]</description>
		<content:encoded><![CDATA[<p>Hello, adamr<br />
Thank you for you interest. Of course, you can do all you need using XSLT, but I think this is not so good solution. It will be better to parse XML using native PHP libraries and build result HTML.</p>
<p>1. You can&#8217;t do this, but&#8230; you have ability to transform XML using XSLT with PHP code, just look at <a href="http://ua2.php.net/manual/en/ref.xslt.php" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/ua2.php.net');">XSLT extension</a> or <a href="http://ua2.php.net/manual/en/ref.domxml.php" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/ua2.php.net');">DOM XML extension</a>. There are many articles in the net about this (just look at <a href="http://www.google.com/search?hl=en&#038;lr=&#038;q=php+transform+xml+with+xslt" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">Google</a></p>
<p>2. To show only lastest of strories you can use something like (XSLT 1.1)</p>
<div class="codecolorer-container xml"><div class="codecolorer" style="font-family: monospace;"><span class="sc3"><span class="re1">&lt;xsl:for-each</span> <span class="re0">select</span>=<span class="st0">&quot;item&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;xsl:sort</span> <span class="re0">select</span>=<span class="st0">&quot;pubDate&quot;</span> <span class="re0">data-type</span>=<span class="st0">&quot;dc:date&quot;</span> <span class="re0">order</span>=<span class="st0">&quot;ascending&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;xsl:if</span> <span class="re0">test</span>=<span class="st0">&quot;position() = 1&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;xsl:apply-templates</span><span class="re2">/&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/xsl:if<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/xsl:for-each<span class="re2">&gt;</span></span></span></div></div>
<p>instead of</p>
<div class="codecolorer-container xml"><div class="codecolorer" style="font-family: monospace;"><span class="sc3"><span class="re1">&lt;xsl:apply-templates</span> <span class="re0">select</span>=<span class="st0">&quot;item&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;xsl:sort</span> <span class="re0">select</span>=<span class="st0">&quot;pubDate&quot;</span> <span class="re0">data-type</span>=<span class="st0">&quot;dc:date&quot;</span> <span class="re0">order</span>=<span class="st0">&quot;ascending&quot;</span><span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;/xsl:apply-templates<span class="re2">&gt;</span></span></span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: adamr</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4980</link>
		<dc:creator>adamr</dc:creator>
		<pubDate>Sat, 30 Nov 2002 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4980</guid>
		<description>Hi, I am slowly developing a website and I wanted to put some RSS feeds into my site to pad out the content. They will update as well which means I don't have to worry about that.

I was thinking of using XSLT and your article is very interesting. I have two questions:
1.  Can I just inlclude the XML file as a PHP include and the page will display the transformed XML as HTML with the rest of the page around it?
2. How can you limit the number of items you bring through. i.e. If you only want the latest story from each feed. 

Thanks for any help/advice in advance!</description>
		<content:encoded><![CDATA[<p>Hi, I am slowly developing a website and I wanted to put some RSS feeds into my site to pad out the content. They will update as well which means I don&#8217;t have to worry about that.</p>
<p>I was thinking of using XSLT and your article is very interesting. I have two questions:<br />
1.  Can I just inlclude the XML file as a PHP include and the page will display the transformed XML as HTML with the rest of the page around it?<br />
2. How can you limit the number of items you bring through. i.e. If you only want the latest story from each feed. </p>
<p>Thanks for any help/advice in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kpumuk</title>
		<link>http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4358</link>
		<dc:creator>Kpumuk</dc:creator>
		<pubDate>Thu, 30 Nov 2000 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/xslt/sorting-rss-feed-by-date-using-xslt/#comment-4358</guid>
		<description>Может это лучше делать на сервере?</description>
		<content:encoded><![CDATA[<p>Может это лучше делать на сервере?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
