Forum Moderators: open

Message Too Old, No Replies

Atom with XSLT

         

ahmedtheking

9:37 pm on Apr 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm on a roll tonight! After doing a simple XSLT with RSS2, I went ahead to try my hand at integrating Atom with XSLT, but it doesn't seem to work! None of the data seems to load up! Here's my code:


<?xml version="1.0" encoding="iso-8859-1"?><!-- DWXMLSource="/xml/news-atom.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY copy "&#169;">
<!ENTITY reg "&#174;">
<!ENTITY trade "&#8482;">
<!ENTITY mdash "&#8212;">
<!ENTITY ldquo "&#8220;">
<!ENTITY rdquo "&#8221;">
<!ENTITY pound "&#163;">
<!ENTITY yen "&#165;">
<!ENTITY euro "&#8364;">
<!ENTITY raquo "&raquo;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- start head -->
<!-- meta -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- end meta -->
<!-- css -->

<!-- end css -->
<!-- alt nav -->

<!-- end alt nav -->
<!-- title -->
<title><xsl:value-of select="feed/title" /></title>
<!-- end title -->
<!-- end head -->
</head>
<body>
<!-- start body -->
<div id="xml">
<div id="xml-top">
<div id="xml-logo">
<div id="logo"></div>
</div>
</div>
<div id="xml-main">
<h1><xsl:value-of select="feed/title" /></h1>
<div class="list"><ul>
<xsl:for-each select="feed/entry">
<li><span class="inner"><a><xsl:attribute name="href"><xsl:value-of select="link/href" /></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="title" /> - <xsl:value-of select="summary" /></xsl:attribute> <span class="title"><span class="date"><xsl:value-of select="updated" /></span> <xsl:value-of select="title" /></span> <span class="des"><xsl:value-of select="summary" /> ... Read More</span></a></span></li>
</xsl:for-each>
</ul></div>
<hr />
<p class="smalltext"><xsl:value-of select="feed/subtitle" />. Last Build Date: <xsl:value-of select="feed/updated" />. Last Published Date: <xsl:value-of select="feed/updated" />. Webmaster: <xsl:value-of select="feed/author/email" />.</p>
</div>
</div>
<div id="xml-bottom">
<a href="/index.html"><img style="position:absolute; top:0; right:10px;" src="/images/builds/1/main/pages/xml/bg_05.png" alt="Go Home" width="171" height="34" /></a></div>
<hr />
<div id="xml-footer" class="smalltext"> ...
</div>
<!-- end body -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>

choster

4:47 pm on Apr 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you be more specific? What do you mean "load up"? Do you get any parsing errors?

ahmedtheking

9:53 pm on Apr 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No no errors, it's just that the atom data doesn't appear.