SQL部分:
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="nodeid"/>
<xsl:param name="orderno"/>
<xsl:param name="filter"/>
<xsl:template match="/">
<root>
<sql>
select top @outnum CM.* From PE_CommonModel CM where CM.NodeID in (select * From SplitID((select arrChildID from PE_Nodes where NodeID=@nodeid),',')) and Status = 99
<xsl:choose>
<xsl:when test="$orderno=1">
order by CM.Hits desc
</xsl:when>
<xsl:when test="$orderno=2">
order by CM.EliteLevel desc, CM.Updatetime desc
</xsl:when>
<xsl:otherwise>
order by CM.Updatetime desc
</xsl:otherwise>
</xsl:choose>
</sql>
</root>
</xsl:template>
</xsl:transform>
标签内容:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
<xsl:output method="html" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:param name="titleLength"/>
<xsl:param name="displayNewSign" />
<xsl:template match="NewDataSet">
<xsl:choose>
<xsl:when test="Table">
<xsl:for-each select="Table">
<li>
<a>
<xsl:attribute name="target">_self</xsl:attribute>
<xsl:attribute name="title">标题:<xsl:value-of select="Title"/> <xsl:value-of select="' '"/>点击数:<xsl:value-of select="Hits"/> <xsl:value-of select="' '"/>发表时间:<xsl:value-of select="pe:FormatDate(UpdateTime, 'yy年mm月dd日')"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="pe:GetInfoPath(NodeID,GeneralID,InputTime,PinyinTitle,HtmlPageName)"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="TitleFontColor != '' or TitleFontType != '字形'">
<span>
<xsl:attribute name="style">
<xsl:if test="TitleFontColor != ''">color:<xsl:value-of select="TitleFontColor"/>;</xsl:if>
<xsl:if test="TitleFontType != '字形'">
<xsl:choose>
<xsl:when test="TitleFontType ='粗体'">font-weight:bold;font-style:normal;</xsl:when>
<xsl:when test="TitleFontType ='斜体'">font-weight:normal ;font-style:italic;</xsl:when>
<xsl:when test="TitleFontType ='粗+斜'">font-weight:bold;font-style:italic;</xsl:when>
<xsl:otherwise>font-weight:normal ;font-style:normal;</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:attribute>
<xsl:value-of select="pe:CutText(pe:RemoveHtml(pe:EncodeText(Title,'htmldecode')),$titleLength,'…')"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="pe:CutText(pe:RemoveHtml(pe:EncodeText(Title,'htmldecode')),$titleLength,'…')"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<span class="missing_data">还没有任何内容!</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
网友评论