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   "&#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;">
]>
<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() &lt;= $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   "&#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;"> ]> <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() &lt;= 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

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support