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

    >> 本版讨论DOM, SAX, XPath等。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DOM/SAX/XPath 』 → xml或xsl中能嵌入javascript吗? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 33793 个阅读者浏览上一篇主题  刷新本主题   平板显示贴子 浏览下一篇主题
     * 贴子主题: xml或xsl中能嵌入javascript吗? 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     white.gourd 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:19
      积分:123
      门派:XML.ORG.CN
      注册:2005/10/28

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给white.gourd发送一个短消息 把white.gourd加入好友 查看white.gourd的个人资料 搜索white.gourd在『 DOM/SAX/XPath 』的所有贴子 引用回复这个贴子 回复这个贴子 查看white.gourd的博客楼主
    发贴心情 

    RE: [xsl] VBScript in XSLT

    Yes.

    You can include javascript or VBscript in your html output.

    Just include it as you want it to be displayed as,

    ie.
    <script>
    function openWindow(url){
      newWindow = window.open(url, 'newWindow',
    'menubar=no,location=no,scrollbars=yes,status=no,resizable=yes,width=640,hei
    ght=480,alwaysRaised')
      newWindow.focus()
    }
    </script>

    But ensure that you escape charactors which would cause problems - ie use
    &gt; rather than '>'

    ie.
    <script>
    If xyz &gt; 1 ...
    </script>

    rather than

    <script>
    If xyz > 1 ...
    </script>

    You can also use <xsl:text disable-output-escaping="yes"><![CDATA[ "your
    code in here"  ]]></xsl:text> if you have a lot of charactors and don't want
    to escape them all

    hope that helps,

    比较懒,直接粘过来了

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/11/10 22:08:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DOM/SAX/XPath 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/25 12:51:13

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

     *树形目录 (最近20个回帖) 顶端 
    主题:  xml或xsl中能嵌入javascript吗?(30字) - 师父2005,2005年10月23日
        回复:  不错,看了有收获(16字) - bruceshen,2006年6月16日
        回复:  我刚发现xsl中加入外部javascript的方法和在html中的方法一样。..(59字) - xiongbajian,2005年12月28日
        回复:  <xsl:value-of select="name"/> ..(233字) - jellifier,2005年12月28日
        回复:  bu cuo(6字) - yishui,2005年11月12日
        回复:  <?xml version="1.0"?><xsl:stylesheet version="1...(1304字) - white.gourd,2005年11月10日
        回复:  <xsl:script language = "language-name" impl..(152字) - white.gourd,2005年11月10日
        回复:  RE: [xsl] VBScript in XSLTYes.You can include..(801字) - white.gourd,2005年11月10日
        回复:  那么知道如何在js读出xml中元素后追加节点,然后调用xsl显示吗?好像调用appendchild..(170字) - 师父2005,2005年10月27日
        回复:  在XSL中可以,XML中没试过(24字) - JavaXML,2005年10月26日
        回复:  我想应该可以的。但我没有试过。(30字) - anchen0617,2005年10月23日
            回复:  继续关注~~~~~(206字) - 师父2005,2005年10月23日

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