XSL Transform Problem
i'm having trouble xsl fragment on page on website. trying feed recent 5 entries blog page on website , present them in descending order. web page @ following link:
http://localhost/sites/newclues/blog.asp
the asp code follows:
<%
var mm_xsl = new mm_xsltransform();
mm_xsl.setxml("http://www.skilfulminds.com/feed/");
mm_xsl.setxsl("headlines.xsl");
response.write (mm_xsl.transform());
%>
the xml tranform seemed work correctly @ first, except didn't display in descending order. however, add blog feed displayed not updating either.
can offer insight i'm doing wrong.
the xsl fragment code below.
___________________________________________________________
<?xml version="1.0" encoding="utf-8"?><!-- dwxmlsource="http://www.skilfulminds.com/feed/" -->
<!doctype xsl:stylesheet [
<!entity nbsp " ">
<!entity copy "©">
<!entity reg "®">
<!entity trade "™">
<!entity mdash "—">
<!entity ldquo "“">
<!entity rdquo "”">
<!entity pound "£">
<!entity yen "¥">
<!entity euro "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:wfw="http://wellformedweb.org/commentapi/" xmlns:atom="http://www.w3.org/2005/atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output method="html" encoding="utf-8"/>
<xsl:param name="itemsperpage" select="5" />
<xsl:template match="/">
<xsl:for-each select="rss/channel/item[position() <= $itemsperpage]">
<xsl:sort select="pubdate" order="descending" />
<p><a href="{link}" target="_blank"><xsl:value-of select="title"/></a><br />
<xsl:value-of select="dc:creator"/></p>
<p><em>description</em></p>
<p><xsl:value-of select="description" disable-output-escaping="yes"/> </p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
thanks in advance,
larry irons
i haven't used xsl transformations asp, following xslt fragment should want:
<?xml version="1.0" encoding="utf-8"?><!-- dwxmlsource="http://www.skilfulminds.com/feed/" --> <!doctype xsl:stylesheet [ <!entity nbsp " "> <!entity copy "©"> <!entity reg "®"> <!entity trade "™"> <!entity mdash "—"> <!entity ldquo "“"> <!entity rdquo "”"> <!entity pound "£"> <!entity yen "¥"> <!entity euro "€"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:wfw="http://wellformedweb.org/commentapi/" xmlns:atom="http://www.w3.org/2005/atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <xsl:output method="html" encoding="utf-8"/> <xsl:template match="/"> <xsl:for-each select="rss/channel/item"> <xsl:if test="position() <= 5"> <p><a href="{rss/channel/item/link}"><xsl:value-of select="title"/></a> <xsl:value-of select="dc:creator"/></p> <p><strong>description:</strong> <xsl:value-of select="description" disable-output-escaping="yes"/></p> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>
More discussions in Develop server-side applications in Dreamweaver
adobe
Comments
Post a Comment