xsl-list
[Top] [All Lists]

[xsl] Make RSS output?

2006-07-31 05:39:29
Hi,

today I have tried to output rss with xsl. I'm using libxslt (which is used by 
php5) to do so, but I always get well-formatted html.

My stylesheet:
=====================================================

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:rss="http://purl.org/rss/1.0/";
                xmlns:dc="http://purl.org/dc/elements/1.1/";
                xmlns:content="http://purl.org/rss/1.0/modules/content/"; 
version="1.0">
    
    <xsl:output method="text" doctype-public="-//Netscape Communications//DTD 
RSS 0.91//EN"
                
doctype-system="http://my.netscape.com/publish/formats/rss-0.91.dtd"; 
encoding="utf-8" /> 
    
    <xsl:template match="/">
        
        <rss version="0.91">
            <channel>
                <title>...</title>
                <link>...</link>
                <description>...</description>
                <language>en-us</language>
                
                <copyright>...</copyright>
                
                <item>
                    <title>...</title>
                    <description>...</description>
                    <link>...</link>
                </item>
            </channel>
        </rss>
        
    </xsl:template>
    
</xsl:stylesheet>


Output:
=====================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <title></title>
  </head>
  <body>
    .........en-us............
  </body>
</html>


It should be something like this:
=====================================================

<?xml version="1.0" encoding="ISO-8859-1" ?>
        <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" 
"http://my.netscape.com/publish/formats/rss-0.91.dtd";>      
        <rss version="0.91">
        <channel>
                <title>...</title>
                <link>...</link>
                <description>...</description>
                <language>en-us</language>

                <copyright>...</copyright>
        
                        <item>

                                <title>...</title>
                                <description>...</description>
                                <link>...</link>
                        </item>
        
        </channel>
        </rss>
        

As I said, I'm using php5 with xsltProcessor and DomDocument, the same way as 
it is used in the example found at 
http://de2.php.net/manual/en/function.xsl-xsltprocessor-construct.php


What is necessary to get there? Can someone please give an example? Google 
returns only tuotrials on how to access rss with xsl.

Thanks, S. Renault.
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>