[thelist] XSLT transformation

shaun at porkandpaws.com shaun at porkandpaws.com
Fri Feb 29 05:42:59 CST 2008


Anyone able to help, 

My colleague is trying to transform some xml that contains the following has
asked me for help but I do not know

<?xml version="1.0" ?>
<rss version="2.0">

<channel xmlns:media="http://search.yahoo.com/mrss/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<title>Customer</title>
<description>Customer RSS News Feed.</description>
<link>http://example.com/rss</link>
<language>en-gb</language>
<atom:link href="http://example.com/rss" rel="self" type="application/rss+xml"
/>
<image><title>Customer</title>
<url>http://example.com/images/feature_box_logo.gif</url>

<link>http://example.com/rss</link>
</image>
<item>
<title>This is an example article1</title>
<description><![CDATA[<p>This is some <strong>BOLD TEXT</strong> and this is
<em>ITALIC </em>and now back to normal!</p><p>A
list.....</p><ul><li>1</li><li>2</li><li>3</li><li>4</li></ul><p>Now some
order...</p><ol><li>a</li><li>b</li><li>c</li><li>d</li></ol><p>Finally a
link... <a href="http://www.google.co.uk/">HERE</a></p>]]></description>
<link>http://example.com/rss/2008/02/20/This-is-an-example-article</link>
<guid>http://example.com/rss/2008/02/20/This-is-an-example-article</guid>
<dc:creator>creator</dc:creator>
<pubDate>20 Feb 2008</pubDate>
<media:group><media:content url="http://example.com/media/sample.jpg"
fileSize="27445" type="image/jpeg" isDefault="true">
<media:rating>nonadult</media:rating>

</media:content>
<media:content url="http://example.com/media/sample.jpg" fileSize="27445"
type="image/jpeg" isDefault="false">
<media:rating>nonadult</media:rating>
</media:content>
</media:group></item>
</channel>

</rss>

He needs to be able to parse both namespaces xsl: and media: 

How? 

Ideally the html would look like

<h2>title</h2>
<p>description</p>
<img src='media:content/@url' ???????????

Help really appreciated..
Even if it is just a pointer to another list or reference.


Shaun





More information about the thelist mailing list