当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·共享(shared)变量的应用范围是    »显示摘要«
    摘要: global全局变量的应用范围是整个应用程序,instance变量的应用范围的应用范围是窗口中,local的应用范围是一个程序段,shared的应用范围是什么?麻烦指点 ......
 ·dcom的小问题,分不够再加    »显示摘要«
    摘要: 小弟刚学dcom编程,照书做了一个例子,当服务器端和客户端都在我机子上时没问题,但我到其他机子上开发客户端就怎么也连不到我的服务器了,computername写了,但servername怎么也找不到我的服务器程序,怎么回事?是不是要控制什么访问权限,急!!!!!(是不是只用serverguid,但connected时说拒绝访问) ......


JSP返回XML/XSL问题

JSP返回XML/XSL,能否给个简单的例子。

NO.1   作者: renzy205

<?xml   version="1.0"     encoding="GB2312"?>  
  <xsl:stylesheet   version="1.0"   xmlns:xsl="http://www.w3.org/TR/WD-xsl">  
  <xsl:template   match="text()"   >  
  <xsl:value-of/>  
  </xsl:template>  
  <xsl:template   match="/">  
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=GB2312"/>  
  <title><xsl:value-of   select="ic/Issue/icName"/></title>  
  <link   rel="sheetstyle"   href="css/csdn.css"   type="text/css"/>  
  </head>  
  <body>  
  <table   width="600"   border="0"   cellspacing="0"   cellpadding="0">  
                      <tr>    
                          <td   width="600"   >  
  <table   width="600"   border="0"   cellspacing="0"   cellpadding="0">  
                                  <tr>    
                                      <td   align="right"   width="80"   valign=""   >主  题:</td>  
                                      <td   align="right"   width="5">   </td>  
                                      <td   class="WithBreaks2"><xsl:value-of   select="ic/Issue/icName"/></td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">作  者:</td>  
                                      <td   align="right"></td>  
                                      <td>  
  <xsl:element   name="a">  
  <xsl:attribute   name="href">/Message_Board/Send.asp?sendto=<xsl:value-of   select="ic/Issue/PostUserName"/></xsl:attribute>  
  <xsl:attribute   name="target">_blank</xsl:attribute>  
  <xsl:value-of   select="ic/Issue/PostUserName"/>   (<xsl:value-of   select="ic/Issue/PostUserNickName"/>)  
  </xsl:element>  
                                      </td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">等  级:</td>  
                                      <td   align="right"></td>  
                                      <td>  
                                      <xsl:apply-templates   select="ic/Issue/ranknum"   />  
                                      <!--  
                                      <xsl:value-of   select="ic/Issue/rank"/>  
                                      //-->  
                                      </td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">信   誉   值:</td>  
                                      <td   align="right"></td>  
                                      <td><xsl:value-of   select="ic/Issue/credit"/></td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">所属论坛:</td>  
                                      <td   align="right"></td>  
                                      <td><xsl:value-of   select="ic/Issue/RoomName"/></td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">问题点数:</td>  
                                      <td   align="right"></td>  
                                      <td><xsl:value-of   select="ic/Issue/Point"/></td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">回复次数:</td>  
                                      <td   align="right"></td>  
                                      <td><xsl:value-of   select="ic/Issue/ReplyNum"/></td>  
                                  </tr>  
                                  <tr>    
                                      <td   align="right">发表时间:</td>  
                                      <td   align="right"></td>  
                                      <td><xsl:value-of   select="ic/Issue/PostDateTime"/></td>  
                                  </tr>  
                                  <tr   height="10">    
                                      <td   align="right">&#9;</td>  
                                      <td   align="right"></td>  
                                      <td>&#9;</td>  
                                  </tr>  
                                  <tr   bgcolor="#666666">    
                                      <td   colspan="3"   height="1">&#9;</td>  
                                  </tr>  
                                  <tr   height="10">    
                                      <td   align="right">&#9;</td>  
                                      <td   align="right"></td>  
                                      <td>&#9;</td>  
                                  </tr>  
                              </table>  
                              <xsl:apply-templates   select="ic/Issue/Content"   />    
                              </td>  
                      </tr>  
                      <tr>  
                          <td   width="600"   height="10">&#9;</td>  
                      </tr>  
                  </table>  
   
  <!--已有回复开始//-->  
  <xsl:apply-templates   select="ic/Replys"/>  
  <!--已有回复结束//-->  
          <table   width="100%"><tr><td   align="left">  
  <xsl:element   name="input">  
  <xsl:attribute   name="type">button</xsl:attribute>  
  <xsl:attribute   name="name">prve</xsl:attribute>  
  <xsl:attribute   name="class">FormText</xsl:attribute>  
  <xsl:attribute   name="onclick">javascript:window.location=/expert/icUp.asp?id=<xsl:value-of   select="ic/Issue/icId"/></xsl:attribute>  
  <xsl:attribute   name="value">将贴子提前</xsl:attribute>  
  </xsl:element>  
                          <xsl:element   name="input">  
  <xsl:attribute   name="type">button</xsl:attribute>  
  <xsl:attribute   name="name">collection</xsl:attribute>  
  <xsl:attribute   name="class">FormText</xsl:attribute>  
  <xsl:attribute   name="onclick">javascript:AddToFavorite()</xsl:attribute>  
  <xsl:attribute   name="value">加入我的收藏夹</xsl:attribute>  
  </xsl:element>  
                          <xsl:element   name="input">  
  <xsl:attribute   name="type">button</xsl:attribute>  
  <xsl:attribute   name="name">B4</xsl:attribute>  
  <xsl:attribute   name="class">FormText</xsl:attribute>  
  <xsl:attribute   name="onclick">javascript:mailto1()</xsl:attribute>  
  <xsl:attribute   name="value">推荐给好友</xsl:attribute>  
  </xsl:element>  
                          </td></tr></table>  
   
  </body>  
  </html>  
  </xsl:template>  
   
  <xsl:template   match="Replys"   >  
  <xsl:for-each   select="Reply"     >  
                  <table   width="580"   border="0"   cellspacing="0"   cellpadding="0"   >  
                      <tr   class="color1"   height="25">    
                          <td   width="20"   >&#9;&#9;&#9;&#9;</td>  
                          <td   width="360"><font   color="#3366CC">  
                          回复人:<b>  
  <xsl:element   name="a">  
  <xsl:attribute   name="href">/Message_Board/Send.asp?sendto=<xsl:value-of   select="PostUserName"/></xsl:attribute>  
  <xsl:attribute   name="target">_blank</xsl:attribute>  
  <font   color="#3366CC">  
  <xsl:value-of   select="PostUserName"/>(<xsl:value-of   select="PostUserNickName   "/>)  
  </font>  
  </xsl:element></b>  
  <font   color="#000000">(  
  <xsl:element   name="img">  
  <xsl:attribute   name="src">/expert/images/rank/<xsl:value-of   select="ranknum"/>.gif</xsl:attribute>  
  <xsl:attribute   name="title"><xsl:value-of   select="rank"/></xsl:attribute>  
  <xsl:attribute   name="alt"><xsl:value-of   select="rank"/></xsl:attribute>  
  </xsl:element>)   信誉:<xsl:value-of   select="credit"/>  
                                  </font></font></td>  
  <td   width="120"><font   color="#000000"><xsl:value-of   select="PostDateTime"   />   </font></td>  
  <td   width="80"><font   color="#000000">得分:</font><font   color="#000000"><xsl:value-of   select="Point"/></font></td>  
                      </tr>  
                      <tr>    
                          <td   bgcolor="#0066CC"   height="1"   colspan="4"></td>  
                      </tr>  
                      <tr>    
                          <td   colspan="4"   height="5"></td>  
                      </tr>  
                      <tr>    
                          <td><font   color="#ffffff">&#160;</font></td>  
                          <td   colspan="3"   >  
                          <xsl:apply-templates   select="Content"   />  
                           
                          </td>  
                      </tr>  
                      <tr>  
                          <td   height="10"   align="right"   colspan="4"><font   color="#FF6633"><b><a   href="#top"><font   color="#3366CC"></font></a></b></font></td>  
                      </tr>  
                      <tr>    
                          <td   colspan="4"   height="5"></td>  
                      </tr>  
                  </table>  
  </xsl:for-each>  
  </xsl:template>  
   
  <xsl:template   match="Content">  
  <table   style="TABLE-LAYOUT:   fixed"   width="580"   cellpadding="3"   >  
  <tr><td>  
  <xsl:element   name="textarea">  
  <xsl:attribute   name="class">content</xsl:attribute>  
  <xsl:attribute   name="readonly">true</xsl:attribute>  
  <xsl:apply-templates   />  
  </xsl:element>  
  </td></tr></table>  
   
  </xsl:template>  
   
  <xsl:template   match="br">  
  <br/>  
  </xsl:template>  
   
   
  <xsl:template   match="ranknum"   >  
  <xsl:element   name="img">  
  <xsl:attribute   name="src">/expert/images/rank/<xsl:value-of   select="/ic/Issue/ranknum"/>.gif</xsl:attribute>  
  <xsl:attribute   name="title"><xsl:value-of   select="ic/Issue/rank"/></xsl:attribute>  
  <xsl:attribute   name="alt"><xsl:value-of   select="ic/Issue/rank"/></xsl:attribute>  
  </xsl:element>  
  </xsl:template>  
   
   
  </xsl:stylesheet>  
  这是test5.xsl文件,和上一个文件放在一起


    摘要: ````````````````````````````````````````````````````````````````````````````````````` ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE