xslt 中调用 focus.swf

本文介绍了一种使用XML结合XSLT技术实现网页图文轮播的方法。通过定义变量来设置轮播图的宽度、高度等参数,并利用XSLT进行数据转换,最终调用focus.swf完成轮播效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<?xml version="1.0" encoding="UTF-8" ?>
<!--图文轮播模板-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="focusWidth" select="'290'"></xsl:variable>
    <xsl:variable name="focusHeight" select="'220'"></xsl:variable>
    <xsl:variable name="textHeight" select="'30'"></xsl:variable>
    <xsl:variable name="swfHeight" select="number($focusHeight)+number($textHeight)"></xsl:variable>
    <xsl:template match="/">
        <div class="focus">
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">
                <xsl:attribute name="width">
                    <xsl:value-of select="$focusWidth"/>
                </xsl:attribute>
                <xsl:attribute name="height">
                    <xsl:value-of select="$focusHeight"/>
                </xsl:attribute>
<xsl:variable name="pics">
                    <xsl:for-each select="List/Object">
                        <xsl:value-of select ="concat(ToUrl,'|')"/>
                    </xsl:for-each>
                </xsl:variable>
                <xsl:variable name="links">
                    <xsl:for-each select="List/Object">
                        <xsl:value-of select ="concat(Url,'|')"/>
                    </xsl:for-each>
                </xsl:variable>
                <xsl:variable name="texts">
                    <xsl:for-each select="List/Object">
                        <xsl:value-of select ="concat(Title,'|')"/>
                    </xsl:for-each>
                </xsl:variable>
                <param name="allowScriptAccess" value="sameDomain"></param>
                <param name="movie" value="../focus.swf"></param>
                <param name="quality" value="high"></param>
                <param name="bgcolor" value="#fffbf2"></param>
                <param name="menu" value="false"></param>
                <param name="wmode" value="opaque"></param>
                <param name="FlashVars">
                    <xsl:attribute name="value">
                        <xsl:value-of select="concat('pics=',substring($pics,1,string-length($pics)-1),'&amp;links=',substring($links,1,string-length($links)-1),'&amp;texts=',substring($texts,1,string-length($texts)-1),'&amp;borderwidth=',$focusWidth,'&amp;borderheight=',$focusHeight,'&amp;textheight=',$textHeight)"/>
                    </xsl:attribute>
                </param>

                <embed src="../focus.swf" wmode="opaque" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" menu="false" bgcolor="#ffffff" >
                    <xsl:attribute name="FlashVars">
                        <xsl:value-of select="concat('pics=',substring($pics,1,string-length($pics)-1),'&amp;links=',substring($links,1,string-length($links)-1),'&amp;texts=',substring($texts,1,string-length($texts)-1),'&amp;borderwidth=',$focusWidth,'&amp;borderheight=',$focusHeight,'&amp;textheight=',$textHeight,' width=',$focusWidth,' height=',$swfHeight,' ')"/>
                    </xsl:attribute>
                </embed>
            </object>
        </div>
    </xsl:template>
</xsl:stylesheet>


javascript的调用方式及focus.swf的下载:http://zhuyiwen.cnblogs.com/archive/2006/06/07/420119.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值