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

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → 请教,转换为html后,自动多出的两个空行是怎么回事呢? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 3351 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 请教,转换为html后,自动多出的两个空行是怎么回事呢? 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     geezercn 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:61
      门派:XML.ORG.CN
      注册:2005/1/22

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给geezercn发送一个短消息 把geezercn加入好友 查看geezercn的个人资料 搜索geezercn在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看geezercn的博客楼主
    发贴心情 请教,转换为html后,自动多出的两个空行是怎么回事呢?

    XML文件:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <div_main>
      <!--××××××××××××××××××××××页面标题 ××××××××××××××××××××××××××××××××-->
      <div_head>
        <text>标题</text>
        <image>image/head_image.png</image>
        <link>#</link>
        <descript>这个记录的是文档标题,必须显示在文件的最上方!</descript>
      </div_head>
      <!--××××××××××××××××××××××页面菜单×××××××××××××××××××××××××××××××××-->
      <div_menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>档案管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>采购管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>销售管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>库存管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>报表管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>系统管理</text>
          <descript></descript>
          <link>#</link>
        </menu>
        <menu>
          <ico>image/menu_ico1.png</ico>
          <text>退出系统</text>
          <descript></descript>
          <link>#</link>
        </menu>
      </div_menu>
      <!--××××××××××××××××××××××页面主显示区域××××××××××××××××××××××××××××××××× -->
      <div_area>
        <group>
          <head>基本档案</head>
          <tr>
            <item>
              <text>商品档案</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>供应商档案</text>
              <http>#</http>
              <descript></descript>
            </item>

            <item>
              <text>客户档案</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>人员信息</text>
              <http>#</http>
              <descript></descript>
            </item>
          </tr>
          <tr>
            <item>
              <text>包装信息</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>其它信息</text>
              <http>#</http>
              <descript></descript>
            </item>
          </tr>

        </group>
        <group>
          <head>核心业务</head>
          <tr>
            <item>
              <text>商品议价</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>供货合同</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>购进计划</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>采购订单</text>
              <http>#</http>
              <descript></descript>
            </item>
          </tr>
          <tr>
            <item>
              <text>收货入库</text>
              <http>#</http>
              <descript></descript>
            </item>
            <item>
              <text>其它信息</text>
              <http>#</http>
              <descript></descript>
            </item>

          </tr>
        </group>
      </div_area>
      <!--××××××××××××××××××××××页面页脚×××××××××××××××××××××××××××××××××××××××-->
      <div_foot>
        <company>广东WEB设计联盟</company>
        <address>广东省深圳市XXX大道123号</address>
        <post>518000</post>
        <telphone>0755-26011111 0755-26011000</telphone>
        <fax>0755-26011111 0755-26011000</fax>
        <http>http://www.chinaweb_design.com.cn</http>
      </div_foot>
    </div_main>

    xsl文件:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- DWXMLSource="div_area_list.xml" -->
    <!DOCTYPE xsl:stylesheet  [
     <!ENTITY nbsp   " ">
     <!ENTITY copy   "©">
     <!ENTITY reg    "®">
     <!ENTITY trade  "™">
     <!ENTITY mdash  "—">
     <!ENTITY ldquo  "“">
     <!ENTITY rdquo  "”">
     <!ENTITY pound  "£">
     <!ENTITY yen    "¥">
     <!ENTITY euro   "€">
    ]>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
      <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        </meta>
        <title>主页面分区导航</title>
        <link href="main_page.css" rel="stylesheet" type="text/css">
        </link>
        <style type="text/css">
    <xsl:comment>
    body {
     margin-bottom: 10px;
    }
    a:link {
     text-decoration: none;
    }
    a:visited {
     text-decoration: none;
    }
    a:hover {
     text-decoration: underline;
    }
    a:active {
     text-decoration: none;
    }
    </xsl:comment>
    </style>
        </head>
        <body>
        <div id="div_main">
          <!--××××××××××××××××××××××页面标题区域××××××××××××××××××××××××××××××××× -->
          <div id="div_head">
            <xsl:for-each select="div_main">
              <!--显示标题文字-->
              <h1> <xsl:value-of select="div_head/text" /> </h1>
              <!--显示标题图片-->
              <xsl:element name="a">
                <xsl:attribute name="href"> <xsl:value-of select="div_head/link"/> </xsl:attribute>
                <xsl:element name="img">
                  <xsl:attribute name="src"> <xsl:value-of select="div_head/image"/> </xsl:attribute>
                </xsl:element>
              </xsl:element>
            </xsl:for-each>
          </div>
          <!--××××××××××××××××××××××页面导航菜单××××××××××××××××××××××××××××××××× -->
          <div id="div_menu">
            <ul>
              <xsl:for-each select="div_main/div_menu/menu">
                <li>
                  <!--显示导航菜单项-->
                  <!--显示导航菜单项的图片-->
                  <xsl:element name="img">
                    <xsl:attribute name="src"> <xsl:value-of select="ico" /> </xsl:attribute>
                  </xsl:element>
                  <xsl:element name="a">
                    <!--显示导航菜单项的链接地址-->
                    <xsl:attribute name="href"> <xsl:value-of select="link"/> </xsl:attribute>
                    <!--显示导航菜单项的文字-->
                    <xsl:value-of select="text" />
                  </xsl:element>
                </li>
              </xsl:for-each>
            </ul>
          </div>
          <!--××××××××××××××××××××××页面主显示区域××××××××××××××××××××××××××××××××× -->
          <div id="div_area">
            <!-- 读取多组项目 -->
            <xsl:for-each select="div_main/div_area/group" >
              <div id="div_area_group">
                <!-- 显示分组标题-->
                <xsl:value-of select="head" />
                <table  border="0" cellspacing="0" cellpadding="0">
                  <!-- 多行项目读取 -->
                  <xsl:for-each select="tr">
                    <tr>
                      <!--行内项目重复读取--> 
                      <xsl:for-each select="item" >
                        <td><xsl:element name="a">
                            <xsl:attribute name="href"> <xsl:value-of select="http" /> </xsl:attribute>
                            <xsl:value-of select="text" />
                          </xsl:element>
                        </td>
                      </xsl:for-each>
                    </tr>
                  </xsl:for-each>
                </table>
              </div>
            </xsl:for-each>
          </div>
          <!--××××××××××××××××××××××页面页脚属性××××××××××××××××××××××××××××××××× -->
          <div id="div_foot">
            <xsl:element name="a">
              <xsl:attribute name="href"> <xsl:value-of select="div_main/div_foot/http" /> </xsl:attribute>
              <xsl:value-of select="div_main/div_foot/company" />
            </xsl:element>
            <p> 地址:<xsl:value-of select="div_main/div_foot/address" /> <xsl:value-of select="div_main/div_foot/post" /> </p>
            <p> 电话:<xsl:value-of select="div_main/div_foot/telphone" /> </p>
            <P> 传真: <xsl:value-of select="div_main/div_foot/fax" /> </P>
            <P>
              <xsl:element name="a">
                <xsl:attribute name="href"> <xsl:value-of select="div_main/div_foot/http" /> </xsl:attribute>
                <xsl:value-of select="div_main/div_foot/http" />
              </xsl:element>
            </P>
          </div>
        </div>
        </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>

    CSS文件:
    @charset "utf-8";
    body {
     margin-left: 0px;
     margin-top: 0px;
     margin-right: 0px;
     margin-bottom: 0px;
    }

    #div_main {
     font-size: 80%;
     margin: 5px;
     width: 1020;
    }
    #div_main  #div_head  {
     float: left;
     width: 100%;
     margin: 0px;
    }
    #div_main #div_head h1 {
     float: right;
     padding-left: 20px;
    }

    #div_main #div_menu {
     float: left;
     margin: 0px;
     width: 100%;
     background-color: #CCFF33;
     height: 28px;
    }
    #div_main #div_menu img {
     padding-right: 6px;
     padding-left: 6px;
    }


    #div_main #div_menu li {
     float: left;
     padding-left: 12px;
     padding-top: 4px;
     padding-right: 6px;
    }
    #div_main #div_menu a {
     text-decoration: none;
    }
    #div_main #div_head img {
     float: left;
     border-top-style: none;
     border-right-style: none;
     border-bottom-style: none;
     border-left-style: none;
    }
    #div_main #div_area {
     width: 100%;
     height: 450px;
     border: 1px solid #999999;
    }
    #div_main #div_area #div_area_group {
     margin: 10px;
     padding-bottom: 20px;
     border-top-width: 1px;
     border-right-width: 1px;
     border-bottom-width: 1px;
     border-left-width: 1px;
     border-bottom-style: solid;
     border-top-color: #CCCC33;
     border-right-color: #CCCC33;
     border-bottom-color: #CCCC33;
     border-left-color: #CCCC33;
    }
    #div_main #div_area #div_area_group h5 {
     padding-top: 8px;
     padding-left: 20px;
     padding-bottom: 0px;
     clear: both;
    }
    #div_main #div_area #div_area_group td {
     padding-left: 16px;
     width: 220px;
     background-image: url(image/list_item.gif);
     background-repeat: no-repeat;
     background-position: left center;
     padding-top: 0px;
    }
    #div_main #div_area #div_area_group table {

    }


    #div_main #div_foot {
     border-top-width: 3px;
     border-right-width: 3px;
     border-bottom-width: 3px;
     border-left-width: 3px;
     border-top-style: solid;
     border-top-color: #00FF00;
     border-right-color: #00FF00;
     border-bottom-color: #00FF00;
     border-left-color: #00FF00;
    }
    #div_main #div_foot p {
     height: 6px;
     margin: 0px;
     padding-top: 0px;
     padding-right: 0px;
     padding-bottom: 0px;
     padding-left: 24px;
    }

    #div_main #div_area p {
     padding: 10px;
    }
    附件中是显示的效果,多出了两个空行,
    谁能帮我一下,看看是怎么回事!


    此主题相关图片如下:
    按此在新窗口浏览图片


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/6/30 15:17:00
     
     Qr 帅哥哟,离线,有人找我吗?
      
      
      威望:9
      等级:博士二年级(版主)
      文章:4392
      积分:29981
      门派:XML.ORG.CN
      注册:2004/5/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给Qr发送一个短消息 把Qr加入好友 查看Qr的个人资料 搜索Qr在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 访问Qr的主页 引用回复这个贴子 回复这个贴子 查看Qr的博客2
    发贴心情 
    把<xsl:for-each select="div_main/div_area/group" >中的注释拿掉就好了。

    ----------------------------------------------
    没人帮忙,那就靠自己,自己才是最好的老师!本人拒绝回答通过站内短消息提出的问题!

    blog:http://Qr.blogger.org.cn

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/7/1 12:10: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/9/23 16:55:07

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

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