[xml] XSLT question, regarding RSS
- From: Colin Fox <cfox cfconsulting ca>
- To: xml gnome org
- Subject: [xml] XSLT question, regarding RSS
- Date: Tue, 27 Apr 2004 01:24:54 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi, all.
I'm playing around with making an RSS aggregator. I've got an XSLT that
handles a number of news sites, but Slashdot's is stumping me.
I've attached my xsl and a cut-down version of the slash rss page.
running
xsltproc -v rss.xsl slashdot_news.xml
on this, I see this near the top of the output:
xsltCompilePattern : parsing 'item'
xsltCompilePattern : parsed item, default priority 0.000000
added pattern : 'item' priority 0.000000
template has 1 inherited namespaces
Then later on, there is this:
xsltProcessOneNode: no template found for item
xsltDefaultProcessOneNode: copy text
Is the fact that it's reporting 1 inherited namespace causing this? This
is quite puzzling.
Any help would be greatly appreciated.
cf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAjhjVoaQ1/feGlJoRAm3RAJ9nRLp93eA2m8Y+EcljnDjB49Y2IwCfR87Z
D6b274GzSkoaPQ30v0QTxwo=
=xdbZ
-----END PGP SIGNATURE-----
<?xml version="1.0"?>
<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://purl.org/rss/1.0/modules/slash/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:syn="http://purl.org/rss/1.0/modules/syndication/">
<channel rdf:about="http://slashdot.org/">
<title>Slashdot</title>
<link>http://slashdot.org/</link>
<description>News for nerds, stuff that matters</description>
<dc:language>en-us</dc:language>
<dc:rights>Copyright 1997-2004, OSDN - Open Source Development Network, Inc. All Rights Reserved.</dc:rights>
<dc:date>2004-04-27T07:43:07+00:00</dc:date>
<dc:publisher>OSDN</dc:publisher>
<dc:creator>pater slashdot org</dc:creator>
<dc:subject>Technology</dc:subject>
<syn:updatePeriod>hourly</syn:updatePeriod>
<syn:updateFrequency>1</syn:updateFrequency>
<syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/2147252"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/229237"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/2143207"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/2135212"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/2259211"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/2130209"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/214256"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/1850237"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/1939200"/>
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=04/04/26/1814257"/>
</rdf:Seq>
</items>
<image rdf:resource="http://images.slashdot.org/topics/topicslashdot.gif"/>
<textinput rdf:resource="http://slashdot.org/search.pl"/>
</channel>
<image rdf:about="http://images.slashdot.org/topics/topicslashdot.gif">
<title>Slashdot</title>
<url>http://images.slashdot.org/topics/topicslashdot.gif</url>
<link>http://slashdot.org/</link>
</image>
<item rdf:about="http://slashdot.org/article.pl?sid=04/04/26/2147252">
<title>Best Images Yet Of Saturn's Moon Titan</title>
<link>http://slashdot.org/article.pl?sid=04/04/26/2147252</link>
<description>DoraLives writes "During recent commissioning observations of a new instrument designed for a
completely different purpose, the European Southern Observatory ...</description>
<dc:creator>timothy</dc:creator>
<dc:subject>space</dc:subject>
<dc:date>2004-04-27T07:06:00+00:00</dc:date>
<slash:department>spaceporn</slash:department>
<slash:section>science</slash:section>
<slash:comments>30</slash:comments>
<slash:hitparade>30,21,12,8,6,2,1</slash:hitparade>
</item>
</rdf:RDF>
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
<!-- RSS -->
<xsl:template match="rdf:rdf">
<p>RDF</p>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="rdf:RDF">
<p>Found an RDF</p>
<p>Blah blah blah</p>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="item" >
<p>Found an RDF Item</p>
<div class='item'>
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="rss">
<p>RSS</p>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="channel">
<div class='channel'>
<p>Channel</p>
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="channel/title">
<h2><xsl:value-of select="text()" /></h2>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="channel/link">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="channel/item">
<div class='item'>
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="channel/item/title">
<h2><xsl:value-of select="text()" /></h2>
</xsl:template>
<xsl:template match="channel/item/link">
<a href="{text()}">Story</a>
</xsl:template>
<xsl:template match="channel/item/description">
<p class='description'><xsl:apply-templates /></p>
</xsl:template>
<!-- arch-tag: 815df896-b72f-4478-a18f-19f72b1e6e98 -->
</xsl:stylesheet>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]