|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
No xslt transformation with an rss
Hello to all:
I'm trying to transform a rss document after visiting many sites, and trying to do many things, i cannot get it to work. It's my first try, and it's very simple, but it seems that the rdf:RDF label is not found and it doesn't process it or something like that. The XSL file is this: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0" > <xsl utput method="html"/><xsl:template match="/"> <html><body> <xsl:apply-templates/> </body></html> </xsl:template> <xsl:template match="/rdf:RDF/item/title"> <h1 align="center"> <xsl:apply-templates/> </h1> </xsl:template> <xsl:template match="//rdf:RDF/item/dc:creator"> <p> <xsl:apply-templates/> </p> </xsl:template> </xsl:stylesheet> And a sample item that i'm trying to transform to html: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://slashcode.com/rss/1.0/modules/Slash/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" > <item rdf:about="http://barrapunto.com/article.pl?sid=04/02/27/0858236"> <title>Inundaron de 'spam' a los propios 'spammers'</title> <link>http://barrapunto.com/article.pl?sid=04/02/27/0858236</link> <dc:creator>JJ</dc:creator> <dc:subject>spam</dc:subject> <dc:date>2004-02-27T08:53:19+00:00</dc:date> <slash:department></slash:department> <slash:section>articles</slash:section> <slash:comments>38</slash:comments> <slash:hitparade></slash:hitparade> </item> THANKS A LOT!!! |
|
#2
|
||||
|
||||
|
Is this your XML input?
Code:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://slashcode.com/rss/1.0/modules/Slash/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" > <item rdf:about="http://barrapunto.com/article.pl?sid=04/02/27/0858236"> <title>Inundaron de 'spam' a los propios 'spammers'</title> <link>http://barrapunto.com/article.pl?sid=04/02/27/0858236</link> <dc:creator>JJ</dc:creator> <dc:subject>spam</dc:subject> <dc:date>2004-02-27T08:53:19+00:00</dc:date> <slash:department></slash:department> <slash:section>articles</slash:section> <slash:comments>38</slash:comments> <slash:hitparade></slash:hitparade> </item> If it is, there is no root element. Also, in the future, you please use the [ code ] and [ /code ] so that the code is neatly formatted? (remove the spaces after an before the [ and ]) -- Thanks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > No xslt transformation with an rss |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|