以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 XSL/XSLT/XSL-FO/CSS 』 (http://bbs.xml.org.cn/list.asp?boardid=8) ---- [求助]xslt排序问题求指教 (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=124079) |
-- 作者:ljuyx -- 发布时间:5/9/2012 4:07:00 PM -- [求助]xslt排序问题求指教 源码 <xsl:template match="/"> <xsl:choose> <xsl:when test="xml/@action='1'"><xsl:call-template name="match_1"/></xsl:when> <xsl:when test="xml/@action='2'"><xsl:call-template name="match_2"/></xsl:when> <xsl:when test="xml/@action='3'"><xsl:call-template name="match_3"/></xsl:when> <xsl:when test="xml/@action='4'"><xsl:call-template name="match_4"/></xsl:when> <xsl:when test="xml/@action='5'"><xsl:call-template name="match_5"/></xsl:when> <xsl:when test="xml/@action='6'"><xsl:call-template name="match_6"/></xsl:when> <xsl:otherwise><xsl:call-template name="other"/></xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="match_1"> <xsl:for-each select="//data"> <li id="img"><a href="/link.asp?id={@id}" target="{@target}" title="{@content}"><img src="{@logourl}" alt="{@content}" /></a></li> </xsl:for-each> </xsl:template> <xsl:template name="match_2"> <xsl:for-each select="//data"> <li id="txt"><a href="/link.asp?id={@id}" target="{@target}" title="{@content}"><xsl:value-of select="@title"/></a></li> </xsl:for-each> </xsl:template> <xsl:template name="match_3"> <xsl:for-each select="//data"><ul> <li id="img"><a href="/link.asp?id={@id}" target="{@target}" title="{@content}"><img src="{@logourl}" alt="{@content}" /></a></li> <li><a href="/link.asp?id={@id}" target="{@target}" title="{@content}"><xsl:value-of select="@title"/></a></li><li id="time"><xsl:value-of select="@addtime"/></li></ul> </xsl:for-each> </xsl:template> <xsl:template name="match_4"> <xsl:for-each select="//data"> <ul><li id="txt"><a href="/link.asp?id={@id}" target="{@target}"><xsl:value-of select="@title"/></a></li><li id="note"><xsl:value-of select="@content"/></li><li id="hits"><xsl:value-of select="@views"/></li></ul> </xsl:for-each> </xsl:template> <xsl:template name="match_5"> <xsl:for-each select="//data"> <ul><li id="img"><xsl:choose><xsl:when test="@logourl=''"><img src="/images/nophoto.gif"/></xsl:when><xsl:otherwise><a href="/link.asp?id={@id}" target="{@target}"><img src="{@logourl}"/></a></xsl:otherwise></xsl:choose></li><li id="note"><xsl:value-of select="@content"/></li><li id="hits"><xsl:value-of select="@views"/></li></ul> </xsl:for-each> </xsl:template> <xsl:template name="match_6"> <xsl:for-each select="//data"> <ul><li id="tit"><span><input type="checkbox" name="id" value="{@id}"/> <a href="/link.asp?id={@id}" target="{@target}"><xsl:value-of select="@title"/></a></span>时间:<xsl:value-of select="@addtime"/></li><li id="img"><xsl:choose><xsl:when test="@logourl=''"><img src="/images/nophoto.gif"/></xsl:when><xsl:otherwise><a href="/link.asp?id={@id}" target="{@target}"><img src="{@logourl}"/></a></xsl:otherwise></xsl:choose></li><li id="note"><font id="fontls">简介:</font><xsl:value-of select="@content"/></li></ul> </xsl:for-each> </xsl:template> <xsl:template name="other"> </xsl:template> </xsl:stylesheet> 这里显示的结果是一个六列的列表,现在我想把6列扩成10列改怎么修改呢?求指点!!! |
-- 作者:ljuyx -- 发布时间:5/10/2012 9:59:00 AM -- 没有人回帖吗?我晕 |
-- 作者:ljuyx -- 发布时间:5/15/2012 11:53:00 AM -- 这么多天了,还是没有人来,心碎了.... |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
2,304.688ms |