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

    >> XML与各种文件格式的相互转换及相关工具。 word to xml, xml to word, html to xml, xml to pdf,
    csv to xml, rtf to xml, text to xml, xml to text, xls to xml, xml to xls
    FOP
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 WORD to XML, HTML to XML 』 → 求跨帧使用xml数据岛的方法 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 8032 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 求跨帧使用xml数据岛的方法 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     lt2000 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:13
      积分:105
      门派:XML.ORG.CN
      注册:2005/5/5

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给lt2000发送一个短消息 把lt2000加入好友 查看lt2000的个人资料 搜索lt2000在『 WORD to XML, HTML to XML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看lt2000的博客楼主
    发贴心情 求跨帧使用xml数据岛的方法

    在本帧显示xml数据岛米问题。但跨帧怎么使用?
    各位指点一下小弟吧。

    父帧文件  main.htm
    --------------------------------------------------------------------
    <html>

    <head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    </head>

    <frameset rows="190,*">
      <frame name="header" scrolling="no" target="main" src="top.htm">
      <frame name="main" src="button.htm">
      <noframes>
      <body>

      <p>此网页使用了框架,但您的浏览器不支持框架。</p>

      </body>
      </noframes>
    </frameset>

    </html>

    带xml数据的文件 top.htm
    ----------------------------------------------------------------------------------------------
    <html>
    <script language=javascript>
    function aaa()
    {
    //alert(document.all.theXMLisland.firstChild.childNodes(0).childNodes(0).Text)
    //  alert(document.all.theXMLisland.recordset("Address").value)
    document.all.theXMLisland.recordset("Address").value="123456"
    }

    function movep()
    {
    if(document.all.theXMLisland.recordset.bof==0)
    theXMLisland.recordset.movePrevious()
    else
    alert("第一条")
    }

    function moven()
    {
    if(document.all.theXMLisland.recordset.eof==0)
    theXMLisland.recordset.moveNext()
    else
    alert("最后一条")
    }

    </script>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 2</title>
    <base target="main">
    </head>

    <body>
    <XML ID="theXMLisland">
    <HotelList>
    <Hotel>
    <Name>四海大酒店</Name>
    <Address>海魂路1号</Address>
    <HomePage>www.sihaohotel.com.cn</HomePage>
    <E-Mail>master@sihaohotel.com.cn</E-Mail>
    <TelePhone>(0989)8888888</TelePhone>
    <Grade>五星级</Grade>
    </Hotel>
    <Hotel>
    <Name>五湖宾馆</Name>
    <Address>东平路99号</Address>
    <HomePage>www.wuhu.com.cn</HomePage>
    <E-Mail>web@wuhu.com.cn</E-Mail>
    <TelePhone>(0979)1111666</TelePhone>
    <Grade>四星级</Grade>
    </Hotel>
    <Hotel>
    <Name>“大沙漠”宾馆</Name>
    <Address>留香路168号</Address>
    <HomePage>www.dashamohotel.com.cn</HomePage>
    <E-Mail>master@dashamohotel.com.cn</E-Mail>
    <TelePhone>(0989)87878788</TelePhone>
    <Grade>五星级</Grade>
    </Hotel>
    <Hotel>
    <Name>“画眉鸟”大酒店</Name>
    <Address>血海飘香路2号</Address>
    <HomePage>www.throstlehotel.com.cn</HomePage>
    <E-Mail>chuliuxiang@throstlehotel.com.cn</E-Mail>
    <TelePhone>(099)9886666</TelePhone>
    <Grade>五星级</Grade>
    </Hotel>
    </HotelList>
    </XML>
    <p><input type="button" value="按钮1" onclick=aaa() name="B3">&nbsp;&nbsp;&nbsp; <input onclick="movep()" type="button" value="上一条" name="B4">&nbsp;&nbsp;
    <input onclick="moven()" type="button" value="下一条" name="B5">&nbsp; <input onclick="theXMLisland.recordset.addNew()" type="button" value="添加" name="B5"></p>
    <form method="POST" action="--WEBBOT-SELF--">
      <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
      S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
      <p><input type="text" datasrc=#theXMLisland DataFLD=NAME name="T1" size="20"></p>
      <p><input type="text"  datasrc=#theXMLisland DataFLD=Address  name="T2" size="20"></p>
    </form>


    <table datasrc=#theXMLisland border="1" width="36%">
      <tr>
        <td width="50%"><div datafld="NAME"></div></td>
        <td  width="50%"><div datafld="Address"></div></td>
      </tr>
    </table>


    </body>

    </html>


    下帧欲显示xml的文件  
    ------------------------------------------------------------------------------------------------------
    <html>

    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 3</title>
    </head>
    <script language=javascript>
    function aaa()
    {
    //alert(document.all.theXMLisland.firstChild.childNodes(0).childNodes(0).Text)
    //  alert(document.all.theXMLisland.recordset("Address").value)
    //window.parent.header.document.all.theXMLisland.recordset("Address").value="123456"
    alert(window.parent.header.document.all.theXMLisland.xml)
    }

    function movep()
    {
    if(document.all.theXMLisland.recordset.bof==0)
    theXMLisland.recordset.movePrevious()
    else
    alert("第一条")
    }

    function moven()
    {
    if(document.all.theXMLisland.recordset.eof==0)
    theXMLisland.recordset.moveNext()
    else
    alert("最后一条")
    }

    </script>

    <body>

    <form method="POST" action="--WEBBOT-SELF--">
      <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
      S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
      <p><input type="button" value="按钮1" onclick=aaa() name="B3">&nbsp;&nbsp;&nbsp; <input onclick="movep()" type="button" value="上一条" name="B4">&nbsp;&nbsp;
    <input onclick="moven()" type="button" value="下一条" name="B5">&nbsp; <input onclick="theXMLisland.recordset.addNew()" type="button" value="添加" name="B5"></p>
    </form>

    <table datasrc=#theXMLisland border="1" width="36%">
      <tr>
        <td width="50%"><div datafld="NAME"></div></td>
        <td  width="50%"><div datafld="Address"></div></td>
      </tr>
    </table>
    </body>

    </html>
    </xml>

    主要是下帧里面,xml的scr路径不会写,请指教


       收藏   分享  
    顶(0)
      




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

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

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