View Single Post
  #1 (permalink)  
Old 06-03-2007, 04:09 PM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 5,120
kgun RepRank 3kgun RepRank 3
Default Smilies turned on, is this code fine?

<?xml version="1.0"?>
<xsl:stylesheet xmlnssl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslaram name="sortparam" select="datetime" />
<xslutput method="html"/>

<xsl:template match="/">
<table>
<xsl:apply-templates select="//channel/item">
<xsl:sort select="../title[$sortparam='channel']" order="ascending" />
<xsl:sort select="./title[$sortparam='title']" order="ascending"
case-order="lower-first" />
<xsl:sort select="./timestamp" order="descending" />
</xsl:apply-templates>
</table>
</xsl:template>

<xsl:template match="channel">
<xsl:element name="channel">
<xsl:copy-of select="title" />
<xsl:copy-of select="link" />
<xsl:apply-templates select="item"/>
</xsl:element>
</xsl:template>

<xsl:template match="item">
<tr>
<td colspan="3">
<a>
<xsl:attribute name="href">
<xsl:value-of select="link" />
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</td>
</tr><tr>
<!-- Insert some non breaking spaces.
Rather than add DTD for nbsp numeric codes are used instead. -->
<td>*****</td>
<td>Channel:
<a>
<xsl:attribute name="href">
<xsl:value-of select="../link" />
</xsl:attribute>
<xsl:value-of select="../title"/>
</a>
</td>
<td>Published: <xsl:copy-of select="pubDate" /></td>
</tr>
</xsl:template>

</xsl:stylesheet>

Conclusion: No it is not.

The 2,3 and fourth line should be:

<xsl:stylesheet xmlns : xsl="XSLT namespace" version="1.0">
<xsl : param name="sortparam" select="datetime" />
<xsl : output method="html"/>

Where I have inserted a space before and after the : with the smilies.

Final conclusion, if you want to write XML and similar code in your posts, you should turn off smilies permanently.

Last edited by kgun : 06-03-2007 at 04:23 PM.
Reply With Quote