XML news source

Other types of input

Until now our pipelines have all started with the RequestGenerator. Let's see a different example, where we retrieve an external XML document via HTTP.

This example requires access to the http://codeconsult.ch/bertrand/index.rdf XML newsfeed.

View the result in your browser: xmlnews.html

Sitemap excerpt

<map:match id="xmlNews" pattern="xmlnews.html">
<map:generate src="http://codeconsult.ch/bertrand/index.rdf"/>
<map:transform src="xsl/news-to-html.xsl"/>
<map:transform src="xsl/html-styling.xsl"/>
<map:serialize type="html"/>
</map:match>

XSL transform

Here we show only the conversion of rss:item elements

<xsl:template name="rssItem" match="rss:item">
<li>
<a href="{@rdf:about}">
<xsl:value-of select="rss:title"/>
</a>
</li>
</xsl:template>

Typical output

<html>
<head>
<link type="text/css" href="css/tour.css" rel="stylesheet"/>
</head>
<body>
<h1> RSS news in HTML </h1>
<ul/>
<p class="footer"> This footer has been added by html-styling.xsl </p>
</body>
</html>