以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  在xsl中使用javascript时遇到的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=43815)


--  作者:cjsy2001
--  发布时间:3/12/2007 11:20:00 AM

--  在xsl中使用javascript时遇到的问题
一段xsl如下:
   <xsl:template name="title"><!--put title here--></xsl:template>
   <xsl:template name="header"><!--put head here--></xsl:template>
   <xsl:template name="body"><!--put body here--></xsl:template>
   <xsl:template name="onload"<!--put onload script here-->></xsl:template>
   <xsl:template name="standard-footer"><!--put footer here--></xsl:template>

  <xsl:template match="/">
        <html>
            <head>
                <title>
                    <xsl:call-template name="title"/>
                </title>
            </head>
            <xsl:element name="body">
                <xsl:call-template name="onload"/>
                <div id="body">
                    <xsl:call-template name="standard-logo"/>
                    <div id="content">
                        <xsl:variable name="header">
                            <xsl:call-template name="header"/>
                        </xsl:variable>
                        <xsl:if test="$header">
                            <h1>
                                <xsl:value-of select="$header"/>
                            </h1>
                        </xsl:if>
                        <xsl:call-template name="body"/>
                    </div>
                </div>
                <xsl:call-template name="standard-footer"/>
            </xsl:element>
        </html>
    </xsl:template>
在onload中有一段javascript程序, 用于toggle一个表数据,现在问题是,当表数据为空时,'standard-footer'中显示的数据有时会‘提前‘显示到'body'区域,一旦有数据时,又会回到'standard-footer'区域正常显示。不知道如何解决这个问题。 谢谢。


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms