以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  求xml高手帮忙看以下代码错误地方在那里  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=16825)


--  作者:mswl
--  发布时间:4/10/2005 9:07:00 PM

--  求xml高手帮忙看以下代码错误地方在那里
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
 <xsl:output method="html" indent="yes" version="4.0"/>
  <!--
 Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
 Written by dvbbs.net Lao Mi
 Web: http://www.aspsky.net/,http://www.dvbbs.net/
 Email: eway@aspsky.net
 -->
 <xsl:variable name="tr1"><![CDATA[<tr>]]></xsl:variable>
 <xsl:variable name="tr2"><![CDATA[</tr>]]></xsl:variable>
 <xsl:variable name="table"><![CDATA[<table cellspacing="2" cellpadding="2" width="100%" border="0">
<tr>
    <td width="100%"  colspan="3">&nbsp; </td>
  </tr>
<tr>
    <td width="25%" valign="middle">&nbsp;</td>
                
    <td width="30%" valign="middle">&nbsp;</td>
                
    <td width="45%" vAlign="middle">&nbsp; </td>
</tr>
<tr>
    <td class="tablebody2" height="20" width=* colspan="3">&nbsp;</td>
</tr>
</table>]]></xsl:variable>
<xsl:template xmlns:xsl="http://www.w3.org/1999/XSL/Transform" match="/">
  <xsl:apply-templates select="BoardList"/>
 </xsl:template>
 <xsl:template xmlns:xsl="http://www.w3.org/1999/XSL/Transform" match="BoardList">

<xsl:for-each select="board">
<table cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
<tr>
    <td width="1" align="left" valign="bottom"><img src=skins/mood/st1.jpg" width=117 height=46 border="0"/></td>
    <td align="middle" width="99%" background="skins/mood/stbg.jpg"></td>
    <td width="1" align="right" valign="bottom"><img src="skins/mood/st2.jpg" width=103 height=46 border="0"/></td>
</tr>
</table>
  <table cellspacing="1"  cellpadding="2" align="center"   class="tableBorder1"  style="border-bottom-style:none">
  <tr>
<td width=24 background=skins/mood/st3.jpg><img src=skins/mood/st3.jpg></td>
<td>

<table cellspacing="1"  cellpadding="2" align="center"   class="tableBorder1"  style="border-bottom-style:none">
     <tr>
       <td align="left" height="20" colspan="6" class="tablebody2"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><span id="titlepic_{@boardid}">
       <a target="hiddenframe">
       <xsl:choose>
      <xsl:when test="@mode!='0'"><xsl:attribute name="href">cookies.asp?action=setlistmod&amp;thisvalue=0&amp;id=<xsl:value-of select="@boardid"/></xsl:attribute>
        <img alt="切换到列表模式" src="Skins/Default/plus.gif" border="0"/>
        </xsl:when>
        <xsl:otherwise>
        <xsl:attribute name="href">cookies.asp?action=setlistmod&amp;thisvalue=1&amp;id=<xsl:value-of select="@boardid"/>
        </xsl:attribute>
        <img alt="切换到简洁模式" src="Skins/Default/nofollow.gif" border="0"/>
        </xsl:otherwise>
        </xsl:choose>
       </a></span>
       <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
       <xsl:choose>
       <xsl:when test="/BoardList/@boardid='0'">
       <a href="index.asp?boardid={@boardid}" title="进入本分类论坛"><xsl:value-of select="@boardtype" disable-output-escaping="yes" /></a>
       </xsl:when>
       <xsl:otherwise><xsl:value-of select="@boardtype" disable-output-escaping="yes" />-论坛列表</xsl:otherwise>
       </xsl:choose>
       </td>
    </tr>
</table>
  <xsl:choose>
 
<xsl:when test="@mode!='1'"><table cellspacing="1" cellpadding="0" align="center" class="tableBorder1">
<tr  height="20">
<td valign="middle"  align="center"  class="tablebody2" ></td>
<td valign="middle"  align="center" class="tablebody2"  ></td>
<td valign="middle"  align="center" class="tablebody2" >论坛</td>
<td valign="middle"  align="center" class="tablebody2" >统计</td>
<td valign="middle"  align="center" class="tablebody2" >最新回复</td>
<td valign="middle"  align="center" class="tablebody2" >斑竹</td>
</tr>
   <xsl:for-each select="board">
   <tr>
        <td valign="middle" width="46" align="center" class="tablebody1">
        <img border="0"><xsl:choose>
        <xsl:when test="@checkout=1">
         <xsl:attribute name="title">认证论坛,<xsl:choose>
         <xsl:when test="@hasnew=1">有新贴子</xsl:when>
         <xsl:otherwise>无新贴子</xsl:otherwise>
         </xsl:choose>
         </xsl:attribute>
         <xsl:attribute name="src"><xsl:value-of select="$pic_2"/></xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
         <xsl:choose>
         <xsl:when test="@hasnew=1"><xsl:attribute name="alt">开放的论坛,有新贴子</xsl:attribute>
         <xsl:attribute name="src"><xsl:value-of select="$pic_1"/></xsl:attribute>
         </xsl:when>
         <xsl:otherwise><xsl:attribute name="alt">开放的论坛,无新贴子</xsl:attribute>
         <xsl:attribute name="src"><xsl:value-of select="$pic_0"/></xsl:attribute>
         </xsl:otherwise>
         </xsl:choose>
        </xsl:otherwise>
        </xsl:choose></img>
        </td>
           <td valign="middle" width="46" align="center"  class="tablebody1" > <xsl:if test="@indeximg!=''">
<table align="left">
<tr><td>
<a href="index.asp?boardid={@boardid}"><img border="0" src="{@indeximg}" alt=""/></a>
</td><td width="20">
</td>
</tr></table></xsl:if>
</td>
<td class="tablebody1" width="*" valign="top" onmouseover="this.className='tablebody2'" onmouseout="this.className='tablebody1'"><a href="index.asp?boardid={@boardid}">
<xsl:if test="count(board)!='0'"><xsl:attribute name="alt">有<xsl:value-of select="count(board)"/>个下属论坛</xsl:attribute>
      </xsl:if>
               <xsl:value-of select="@boardtype" disable-output-escaping="yes"/></a>
             <xsl:if test="count(board)!='0'"><a><xsl:attribute name="onmouseover">showmenu(event,BoardJumpList(<xsl:value-of select="@boardid"/>),0);</xsl:attribute>(<xsl:value-of select="count(board)"/>)</a></xsl:if>
<table border="0" align="left" cellpadding="0" cellspacing="0"><tr>
<td width="*" height="30" valign="bottom"><font face="Arial"><img alt="" src="Skins/Default/Forum_readme.gif" align="middle"/>
<xsl:value-of select="@readme" disable-output-escaping="yes"/></font></td>
</tr></table>
</td>
  <td  valign="middle" class="tablebody2" width="7%"><table width="100%" border="0">
      <tr>
       <td  valign="middle" nowrap="nowrap"><img src="Skins/Default/Forum_today.gif"  alt="今日发贴数" align="absmiddle"/><font color="red"><xsl:value-of select="@todaynum"/></font></td>
       
      </tr>
      <tr>
        <td valign="middle" nowrap="nowrap"><img src="Skins/Default/forum_topic.gif" alt="主题贴数" border="0"  align="absmiddle"/><xsl:value-of select="@topicnum"/></td>
      </tr>
      <tr>
        <td valign="middle" nowrap="nowrap"><img src="Skins/Default/Forum_post.gif" alt="发贴总数" border="0" align="absmiddle" /><xsl:value-of select="@postnum"/></td>
      </tr>
      </table></td>
               <td width="18%" nowrap="nowrap"  class="tablebody1">
             <xsl:choose>
              <xsl:when test="@checkout='1'">
              <div></div>
              <div>认证论坛,请认证用户进入浏览</div>
              <div></div>
              </xsl:when>
              <xsl:otherwise>
               <div>主题: <a href="Dispbbs.asp?boardid={@lastpost7}&amp;ID={@lastpost6}&amp;replyID={@lastpost1}&amp;skin=1"><xsl:value-of select="@lastpost3"/></a></div>
               <div>发贴: <a href="dispuser.asp?id={@lastpost5}"><xsl:value-of select="@lastpost0"/></a></div>
               <div>日期: <xsl:value-of select="@lastpost2"/> <a href="Dispbbs.asp?boardid={@lastpost7}&amp;ID={@lastpost6}&amp;replyID={@lastpost1}&amp;skin=1"><img border="0" src="Skins/Default/lastpost.gif" title="主题:{@lastpost3}"/></a></div>
              </xsl:otherwise>
               </xsl:choose>
               </td><td  valign="middle" class="tablebody2" width="16%" align="center" ><xsl:for-each select="boardmasterlist"><xsl:if test="5 &gt; position()">
          <a  href="Dispuser.asp?name={@urlencode}" title="查看版主 {@master} 的资料" target="_blank"><xsl:value-of select="@master"/></a><xsl:text disable-output-escaping="yes">&amp;nbsp; </xsl:text>
          </xsl:if>
       <xsl:if test="last() >4 and position()=last()"><font color="gray">More</font></xsl:if>
      </xsl:for-each>
      </td>
     </tr>
    
   </xsl:for-each>
</table>
</TD>
          </TR>
        </TABLE> </td>
<td width=23 background=skins/mood/st4.jpg><img src=skins/mood/st4.jpg></td>
</tr>
</table>
<table width='100%' height=28 border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td wudth=107><img src=skins/mood/st5.jpg></td>
<td width=100% background=skins/mood/st6.jpg>&nbsp;</td>
<td wudth=108><img src=skins/mood/st7.jpg></td>
</tr>
</table>
<br/>
</xsl:when>
   <xsl:otherwise><xsl:variable name="simplenesswidth"><xsl:value-of select="floor(1 div (@simplenessCount) * 100) " />%</xsl:variable><table cellspacing="1" cellpadding="0" align="center" class="tableBorder1"> 
    <xsl:for-each select="board">
    <xsl:if test="position()-1 mod (../@simplenessCount)='0'">
     <xsl:value-of select="$tr1" disable-output-escaping="yes"/>
    </xsl:if>
    <td class="tablebody1">
     <xsl:attribute name="width"><xsl:value-of select="$simplenesswidth" /></xsl:attribute>
     <table cellspacing="2" cellPadding="2" width="100%" border="0">
      <tr>
       <td width="100%" colspan="3">
       <xsl:attribute name="title"><xsl:value-of select="@readme" /></xsl:attribute>
        <a>
             <xsl:attribute name="href">index.asp?boardid=<xsl:value-of select="@boardid"/>
      </xsl:attribute>
      <xsl:if test="count(board)!='0'">
      <xsl:attribute name="title">有<xsl:value-of select="count(board)"/>个下属论坛</xsl:attribute>
      </xsl:if>
               <xsl:value-of select="@boardtype" disable-output-escaping="yes"/></a>
             <xsl:if test="count(board)!='0'"><a><xsl:attribute name="onmouseover">showmenu(event,BoardJumpList(<xsl:value-of select="@boardid"/>),0);</xsl:attribute>(<xsl:value-of select="count(board)"/>)</a></xsl:if></td>
      </tr>
      <tr>
       <td width="30%" valign="middle" nowrap="nowrap"><img src="Skins/Default/Forum_today.gif"  alt="今日发贴数" align="absmiddle"/> <font color="red"><xsl:value-of select="@todaynum"/></font></td>
       <td width="30%" valign="middle" nowrap="nowrap"><img src="Skins/Default/forum_topic.gif" alt="主题贴数" border="0"  align="absmiddle"/> <xsl:value-of select="@topicnum"/></td>
       <td width="40%" vAlign="middle" nowrap="nowrap"><img src="Skins/Default/Forum_post.gif" alt="发贴总数" border="0" align="absmiddle" /> <xsl:value-of select="@postnum"/></td>
      </tr>
      <tr>
          <td class="tablebody2" height="20" width="*" colspan="3" >版主:<xsl:for-each select="boardmasterlist"><xsl:if test="3 &gt; position()">
          <a  href="Dispuser.asp?name={@urlencode}" title="查看版主 {@master} 的资料" target="_blank"><xsl:value-of select="@master"/></a> <xsl:text disable-output-escaping="yes">&amp;nbsp; </xsl:text>
          </xsl:if>
       <xsl:if test="last() >2 and position()=last()"><font color="gray">More</font></xsl:if>
      </xsl:for-each>
      
      </td>
        </tr>
     </table>
    </td>
    <xsl:if test="position() mod (../@simplenessCount)=0 or position()=last()">
     <xsl:if test="(position() mod (../@simplenessCount))!='0'">
      <td class="tablebody1" colspan="{../@simplenessCount}">
       <xsl:value-of select="$table" disable-output-escaping="yes"/>
      </td>
     </xsl:if>
     <xsl:value-of select="$tr2" disable-output-escaping="yes"/>
    </xsl:if>
   </xsl:for-each>
   </table>
></td>
<td width=23 background=skins/mood/st4.jpg><img src=skins/mood/st4.jpg></td>
</tr>
</table>
<table width='100%' height=28 border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td wudth=107><img src=skins/mood/st5.jpg></td>
<td width=100% background=skins/mood/st6.jpg>&nbsp;</td>
<td wudth=108><img src=skins/mood/st7.jpg></td>
</tr>
</table>

   </xsl:otherwise>
   </xsl:choose>
 </xsl:for-each>
 <xsl:if test="/BoardList/@boardid='0'">
 <xsl:value-of select="$links" disable-output-escaping="yes"/>
 </xsl:if>
 </xsl:template>
</xsl:stylesheet>


--  作者:mswl
--  发布时间:4/10/2005 9:08:00 PM

--  
红色部分一删除就正常,不知道红色部分有什么问题!请问怎么解决,想保留红色部分代码的效果在
--  作者:mswl
--  发布时间:4/11/2005 4:50:00 PM

--  
那位大哥帮帮忙啊?
急啊
--  作者:cookieboy
--  发布时间:4/12/2005 9:17:00 PM

--  
关注ing!
--  作者:hecan8110
--  发布时间:5/19/2005 4:22:00 PM

--  
不好意思,小弟无能为力

--  作者:IE浏览器
--  发布时间:5/20/2005 9:21:00 AM

--  
把所有的属性值都 “”



--  作者:mylvchao63
--  发布时间:5/20/2005 1:11:00 PM

--  
就是有高手也不敢看。
好晕好晕!
给点耐心!
--  作者:yannick
--  发布时间:6/3/2005 8:45:00 AM

--  
结构毫不清晰哦
应该下缩进一下再看
很有可能是尖括号没匹配
--  作者:reachcool
--  发布时间:6/7/2005 3:27:00 PM

--  
ft,能不能弄得好看一点啊!晕死我了
--  作者:lisa780
--  发布时间:6/14/2005 10:15:00 PM

--  
刚看一半就想吐了!
不要说找错误,看完都晕了~

--  作者:jx27
--  发布时间:6/16/2005 8:01:00 PM

--  
楼主,首先,你把编译器提示的错误也写出来;其次,红色部分里面的TAG没有匹配(不知道是不是截取的问题);最后,你的CODE没有COMMENTS,所以别人很难理顺你的思路。

DEBUG?难!难!难!


--  作者:dysunny
--  发布时间:6/22/2005 1:04:00 PM

--  
<td align="middle" width="99%" background="skins/mood/stbg.jpg"/>红色第四行
<table cellspacing="1"  cellpadding="2" align="center"   class="tableBorder1"  style="border-bottom-style:none">
红色第八行没有标记没结束吧加个</table>
<img src=skins/mood/st3.jpg/>红色第十行
<img src=skins/mood/st4.jpg/>红色第十二行
<img src=skins/mood/st5.jpg/>红色第十七行
<td width=100% background=skins/mood/st6.jpg/>红色第十八行
<img src=skins/mood/st7.jpg/>红色第十九行
<img src=skins/mood/st4.jpg/>红色第二十三行
<td wudth=107><img src=skins/mood/st5.jpg/></td>红色二十八行
<td width=100% background=skins/mood/st6.jpg/>
<td wudth=108><img src=skins/mood/st7.jpg/></td>
--  作者:syp321
--  发布时间:7/7/2005 9:38:00 AM

--  
看出来了,就是红色部份的:<img src=skins/mood/st7.jpg>,应该写成:
<img src=skins/mood/st7.jpg/>,后面你没加结束符号“/”
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
109.375ms