xsl-list
[Top] [All Lists]

RE: [xsl] Make RSS output?

2006-07-31 05:47:43
Hi, 

Yopu specified "text" as your desired output format, which doesn't seem to be 
what you wanted. 
Change 

<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" />

to 

<xsl:output method="xml" doctype-public="-//Netscape 
Communications//DTD RSS 0.91//EN" 
doctype-System="http://my.netscape.com/publish/formats/rss-0.91.dtd"; 
encoding="utf-8" />

and you get it.

best regards,
Roman

-----Original Message-----
From: Smoother(_at_)gmx(_dot_)de [mailto:Smoother(_at_)gmx(_dot_)de] 
Sent: Monday, July 31, 2006 2:39 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Make RSS output?

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.9
1.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>
--~--



--~------------------------------------------------------------------
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>