<input type="button" value="play">
<xsl:attribute name="onclick">window.location=<xsl:value-of select="url"/>
</xsl:attribute>
</input>

解决方案 »

  1.   

    和在html中差不多,注意标记封闭,格式符合xml即可
      

  2.   

    我想让一个media在本网页上播放
      

  3.   

    http://community.csdn.net/Expert/topic/3427/3427143.xml?temp=.714184
      

  4.   

    http://www.blueidea.com/tech/web/2003/1390.asp
      

  5.   

    回复人: saucer(思归) ( ) 信誉:495  2004-10-5 10:30:59  得分: 100  
     
     
       
    1. TestMedia.xml:<?xml-stylesheet type="text/xsl" href="TestMedia.xsl"?>
    <media>
     <file>
    <name>懂你</name>
    <url>http://www.greensunshine.com.cn/jtgg/mp3/dongni.mp3</url>
    </file>
     <file>
    <name>Everything I Do</name>
    <url>http://www.loverstory.com/music/adams1.MP3</url>
    </file>
    </media>2. TestMedia.xsl:<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
     <xsl:template match="/">
    <html>
    <body>
    <xsl:apply-templates />
    </body>
    </html>
     </xsl:template>
     <xsl:template match="media">
     <OBJECT
      ID="mediaPlayer"
      CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
      CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/
        nsmp2inf.cab#Version=5,1,52,701"
      STANDBY="Loading Microsoft Windows Media Player components..."
      TYPE="application/x-oleobject">
      <PARAM NAME="fileName" VALUE=""/>
      <PARAM NAME="animationatStart" VALUE="true"/>
      <PARAM NAME="transparentatStart" VALUE="true"/>
      <PARAM NAME="autoStart" VALUE="true"/>
      <PARAM NAME="showControls" VALUE="true"/>
    </OBJECT>
    <br /> <xsl:apply-templates />
     </xsl:template>
     <xsl:template match="file">
    <input type="button" value="{name}" onclick="mediaPlayer.FileName='{url}'" /><br/>
     </xsl:template></xsl:stylesheet>