<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Parsing newsfeeds with XSL (1)</title>
	<atom:link href="http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/</link>
	<description>The Art of Quick &#38; Dirty Programming</description>
	<lastBuildDate>Sat, 04 Feb 2012 23:58:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dinner Ideas</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-46544</link>
		<dc:creator>Dinner Ideas</dc:creator>
		<pubDate>Wed, 16 Sep 2009 09:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-46544</guid>
		<description>Hey very nice blog!!  Will add to feed reader :-)</description>
		<content:encoded><![CDATA[<p>Hey very nice blog!!  Will add to feed reader <img src='http://www.mybelovedphp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-46508</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 07 Jul 2009 15:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-46508</guid>
		<description>Hello, I dont know how your blog came up, must have been a typo, Your blog looks awesome, I&#039;ll be back :)</description>
		<content:encoded><![CDATA[<p>Hello, I dont know how your blog came up, must have been a typo, Your blog looks awesome, I&#8217;ll be back <img src='http://www.mybelovedphp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmer</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-45323</link>
		<dc:creator>programmer</dc:creator>
		<pubDate>Fri, 20 Feb 2009 09:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-45323</guid>
		<description>@XSL. Thx, you&#039;re right, last line was missing. I use the code, so I can assure you it&#039;s working. Problem is sometimes to get the code pass TinyMCE. And that can be tricky, as you said yourself. I will see into that.</description>
		<content:encoded><![CDATA[<p>@XSL. Thx, you&#8217;re right, last line was missing. I use the code, so I can assure you it&#8217;s working. Problem is sometimes to get the code pass TinyMCE. And that can be tricky, as you said yourself. I will see into that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: XSL guy</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-45165</link>
		<dc:creator>XSL guy</dc:creator>
		<pubDate>Sat, 14 Feb 2009 15:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-45165</guid>
		<description>And, of course, my XSL got eaten on submission, so it can&#039;t be seen...</description>
		<content:encoded><![CDATA[<p>And, of course, my XSL got eaten on submission, so it can&#8217;t be seen&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: XSL guy</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-45164</link>
		<dc:creator>XSL guy</dc:creator>
		<pubDate>Sat, 14 Feb 2009 15:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-45164</guid>
		<description>Your XSL can&#039;t work because you aren&#039;t closing your tags right and you aren&#039;t even closing the xsl:stylesheet at all. Plus, there&#039;s a rogue space between &quot;xsl:&quot; and &quot;value of.&quot; The use of &quot;//&quot; is very inefficient, but in this case probably won&#039;t do too much harm.

Use this instead:



    
    
    
        
            
                
                    &lt;a href=&quot;{link}&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;
                
            
        
    
</description>
		<content:encoded><![CDATA[<p>Your XSL can&#8217;t work because you aren&#8217;t closing your tags right and you aren&#8217;t even closing the xsl:stylesheet at all. Plus, there&#8217;s a rogue space between &#8220;xsl:&#8221; and &#8220;value of.&#8221; The use of &#8220;//&#8221; is very inefficient, but in this case probably won&#8217;t do too much harm.</p>
<p>Use this instead:</p>
<p>                    <a href="{link}" rel="nofollow"></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmer</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-4501</link>
		<dc:creator>programmer</dc:creator>
		<pubDate>Mon, 30 Jul 2007 13:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-4501</guid>
		<description>That does depend of which PHP version you use. For PHP 5, which uses the newer and faster XSL extension based on libxslt, XSLT support is installed by default.
For PHP4 XSLT support is based on the Sablotron library, which you have to install and compile into PHP with  --enable-xslt --with-xslt-sablot options or the domxml library.

The XSLT code presented above is the same, it&#039;s simple XSLT 1.0 and is supported by all libraries.
In PHP 4 the functions to process the translation would be something like:
$xmldoc = domxml_open_file($xml);
$xsldoc = domxml_xslt_stylesheet ($xslt); 
$result =  $xsldoc-&gt;process($xmldoc); 
print $xsldoc-&gt;result_dump_mem($result);

As you can see this is not &#039;clean&#039; object-orientated.

A powerfull option for PHP5, (and not well known), is that you can mix the XSLT with PHP functions:
&lt;xsl :value-of select=&quot;php:function(&#039;MYFUNCTION&#039;, arguments)&quot; /&gt;
Before that you have to setup the processor to allow PHP like:
$xslt-&gt;registerPHPFunctions(&#039;MYFUNC&#039;);
This will enhance the ease of XSLT enormously; the downside is that you can&#039;t use your XLST code elsewhere.</description>
		<content:encoded><![CDATA[<p>That does depend of which PHP version you use. For PHP 5, which uses the newer and faster XSL extension based on libxslt, XSLT support is installed by default.<br />
For PHP4 XSLT support is based on the Sablotron library, which you have to install and compile into PHP with  &#8211;enable-xslt &#8211;with-xslt-sablot options or the domxml library.</p>
<p>The XSLT code presented above is the same, it&#8217;s simple XSLT 1.0 and is supported by all libraries.<br />
In PHP 4 the functions to process the translation would be something like:<br />
$xmldoc = domxml_open_file($xml);<br />
$xsldoc = domxml_xslt_stylesheet ($xslt);<br />
$result =  $xsldoc->process($xmldoc);<br />
print $xsldoc->result_dump_mem($result);</p>
<p>As you can see this is not &#8216;clean&#8217; object-orientated.</p>
<p>A powerfull option for PHP5, (and not well known), is that you can mix the XSLT with PHP functions:<br />
<xsl :value-of select="php:function('MYFUNCTION', arguments)" /><br />
Before that you have to setup the processor to allow PHP like:<br />
$xslt->registerPHPFunctions(&#8216;MYFUNC&#8217;);<br />
This will enhance the ease of XSLT enormously; the downside is that you can&#8217;t use your XLST code elsewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Bishop</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-4267</link>
		<dc:creator>Chad Bishop</dc:creator>
		<pubDate>Sat, 21 Jul 2007 18:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-4267</guid>
		<description>thnx for the nice, clear write up btw.</description>
		<content:encoded><![CDATA[<p>thnx for the nice, clear write up btw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Bishop</title>
		<link>http://www.mybelovedphp.com/2006/10/11/parsing-newsfeeds-with-xsl/comment-page-1/#comment-4266</link>
		<dc:creator>Chad Bishop</dc:creator>
		<pubDate>Sat, 21 Jul 2007 18:02:29 +0000</pubDate>
		<guid isPermaLink="false">http://mybelovedphp.com/?p=4#comment-4266</guid>
		<description>Just getting back into some XSLT, and have a request to get libxslt installed on the server now.

Any similar code that will work with the more &quot;standardly&quot; distributed PHP/XSL library?

or does libxslt simply do a much better job at making things simpler?

-cb</description>
		<content:encoded><![CDATA[<p>Just getting back into some XSLT, and have a request to get libxslt installed on the server now.</p>
<p>Any similar code that will work with the more &#8220;standardly&#8221; distributed PHP/XSL library?</p>
<p>or does libxslt simply do a much better job at making things simpler?</p>
<p>-cb</p>
]]></content:encoded>
	</item>
</channel>
</rss>

