新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 计算机科学论坛XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → 求教2个XSLT属性连接问题(属性值的确认) 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4791 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 求教2个XSLT属性连接问题(属性值的确认) 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     elfmatian 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:70
      门派:XML.ORG.CN
      注册:2008/3/12

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给elfmatian发送一个短消息 把elfmatian加入好友 查看elfmatian的个人资料 搜索elfmatian在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看elfmatian的博客楼主
    发贴心情 求教2个XSLT属性连接问题(属性值的确认)

    1.xslt
    <?xml version="1.0" encoding="gb2312"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="html" version="1.0" encoding ="gb2312" indent="yes"/>
     <xsl:param name="add_topic"/>
    <xsl:template match="/">
        <html>

      <head>
       <link href="../css/forum.css" type="text/css" rel="stylesheet"></link>
       <title></title>
      </head>
      <body>
       <a href="../default.aspx" class="h1">返回首页</a>
       <a href="{$add_topic}" class="h1">我要发言</a>
       <a href="../user/find.aspx">查询</a>
       <table align="center">
       <tbody>

        <xsl:for-each select ="topics">
         <tr>
          <td align="center">主题</td>
          <td align="center">内容</td>
          <td align="center">发表时间</td>
          <td align="center" width="150px">回复</td>
         </tr>

         <xsl:for-each select ="topic">
          <tr>
           <td>
            <a>
             <xsl:attribute name="href">
              http://localhost/BBS/test.aspx?id=<xsl:value-of select ="@id"/>
             </xsl:attribute>
             <xsl:value-of select="subject"/>
            </a>

           </td>
           <td align="center">
            <xsl:value-of select ="content"/>
           </td>
           <td align="center">
            <xsl:value-of select ="date"/>
           </td>
           <td align="center">
            <xsl:value-of  select ="count(reply)"/>
           </td>
          </tr>
         </xsl:for-each>
        </xsl:for-each>
       </tbody>
       </table>
       
    </br>
      </body>
        </html>
    </xsl:template>

    </xsl:stylesheet>

    2.xslt
    <?xml version="1.0" encoding="gb2312"?>

    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:import href="xslt/topic_list.xslt"/>
     <xsl:output method="html" version="1.0" encoding ="gb2312" indent="yes"/>
     <xsl:param name="topic_id"></xsl:param>
     <xsl:template match="/">
      
      <!--
            This is an XSLT template file. Fill in this area with the
            XSL elements which will transform your XML to XHTML.
        -->
      <a  href="./user/topic_list.aspx" class="h1"> 快速返回</a>
      <table align="center">
       <tbody>
        <xsl:if test="topics/topic[@id]=$topic_id">
         <xsl:for-each select ="topic" >

          <tr>
           <td>
            主题:<xsl:value-of select ="subject"/>
           </td>
          </tr>
          <tr >
           <td>
            发布时间:<xsl:value-of select ="date"/>
           </td>
          </tr>
          <xsl:if test="author!=''">
           <tr>
            <td>
             发布人:<xsl:value-of select ="author"/>
            </td>
           </tr>
          </xsl:if>
          <tr>
           <td>
            主题内容:<xsl:value-of select ="content"/>
           </td>
          </tr>


          <xsl:for-each select ="reply">
           <tr>
            <td>回复:</td>
           </tr>
           <xsl:if test="reply_author!=''">
            <tr >
             <td>
              <xsl:value-of select="reply_author"/>
             </td>
            </tr>
           </xsl:if>
           <tr >
            <td>
             <xsl:value-of select ="reply_date"/>
            </td>
           </tr>
           <tr >
            <td>
             <xsl:value-of select="reply_content"/>
            </td>
           </tr>
          </xsl:for-each>
         </xsl:for-each>
        </xsl:if>

        <tr>
         <td>
         </td>
        </tr>

       </tbody>
      </table>
     </xsl:template>
    </xsl:stylesheet>

    第一个XSLT定义了个href  现在想在第二个XSLT里面想调用那个href  怎么办啊 调试很久都不行 代码还是别人的  因为是XML新手 求教大大吗  在线等啊
    谁能救我 加我QQ276230622 帮忙下


    [此贴子已经被作者于2008-5-13 16:44:58编辑过]

       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/5/13 15:49:00
     
     elfmatian 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:70
      门派:XML.ORG.CN
      注册:2008/3/12

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给elfmatian发送一个短消息 把elfmatian加入好友 查看elfmatian的个人资料 搜索elfmatian在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看elfmatian的博客2
    发贴心情 
    5555555555555大大们都在吗 等待啊   怎么在test里面检验1.xslt中的href 单独显示啊
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/5/13 15:56:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2025/6/24 2:50:51

    本主题贴数2,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    77.148ms