DSO(可下载实例代码)

 

代码下载

 

文章概要:

  • 相关概念;
  • recordset的使用;
  • 使用XML数据岛和XSLT转换输出样式;

一、几个简单的概念:

  1. DSO(Data Source Object):XML DSO就是一个Microsoft ActiveX控件,嵌入到Microsoft Internet Explorer中;
  2. XML数据岛:<XML>和 </XML>标签之间绑定的XML数据称为XML数据岛;

 

 

二、DSO将所有的记录存储在recordset对象中,而recordset对象的属性和方法可以用于做操作记录。下面的实例感觉起来和DetalsView类似:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
    <script  type ="text/javascript" >
    function previor()
    {
     if(!mybook.recordset.bof)
     {
      mybook.recordset.moveprevious();
      if(mybook .recordset.bof)
      {
       mybook.recordset.movefirst();
       alert("已经到达第一条记录");
      }
     }
    }
    function next()
    {
      if(!mybook.recordset.eof)
      {
         mybook.recordset.movenext();
        if(mybook.recordset.eof)
        {
        mybook.recordset.movelast();
        alert ("这是最后一条记录");
        }
      }
    }
    </script>
</head>
<body>
<xml src="books.xml" id="mybook"></xml>

    <table  border="1">
      <tr>
         <td>书名</td>
         <td>作者</td>
         <td>价格</td>
      </tr>
      <tr>
        <td><div datasrc="#mybook" datafld="title" ></div></td>
        <td><div datasrc="#mybook" datafld="authorname"></div></td>
        <td>  <div datasrc="#mybook" datafld="price"></div></td>
      </tr>
     </table>
<input  type ="button"  value="首条"   onclick ="mybook.recordset.movefirst()"/>
     <input  type="button"  value="下一个"  onclick ="next()"/>
     <input  type ="button"  value="上一个" onclick ="previor()" />
     <input  type ="button"  value="末条"  οnclick="mybook.recordset.movelast()" />
   
</body>
</html>
还有和Gridview类似实现:
<xml src="books.xml" id="mybook"></xml>
   
     <table  datasrc="#mybook" border ="1">
     <thead>
      <tr>
           <td  > 书名</td>
           <td  >作者</td>
           <td  >价格</td>
        </tr>
     </thead>
       
        <tr >
           <td  ><div datafld="title"></div></td
           ><td  ><div datafld="authorname"></div></td>
           <td  ><div datafld="price"></div></td>
        </tr>
     </table>
三、转换输出样式:
首先需要两个XML数据岛
    <xml src="books.xml" id="mybook"></xml>
    <xml src="XSLTFile.xslt"  id="stylesheet"></xml>
然后
           var xmlDso = mybook.XMLDocument;
            var xslDso = stylesheet.XMLDocument;
            divResults.innerHTML = xmlDso.transformNode(xslDso);
最后输出:
哲学
马克思
100
计算机科学与技术
比尔盖茨
200
.net
蜡笔小新
150

转载于:https://www.cnblogs.com/LittleFeiHu/archive/2010/12/04/1890579.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
2023-06-17 23:47:22.786162: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2023-06-17 23:47:22.786281: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2023-06-17 23:47:24.419330: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found 2023-06-17 23:47:24.419809: W tensorflow/stream_executor/cuda/cuda_driver.cc:263] failed call to cuInit: UNKNOWN ERROR (303) 2023-06-17 23:47:24.426229: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: ����� 2023-06-17 23:47:24.426345: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: ����� 2023-06-17 23:47:24.430552: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. Traceback (most recent call last): File "C:\Users\10290\Desktop\test\writer.py", line 20, in <module> write_reward_tb(summary_writer, rewards[i], i) File "C:\Users\10290\Desktop\test\writer.py", line 9, in write_reward_tb summary = tf.Summary(value=[tf.Summary.Value(tag='reward', simple_value=reward)]) AttributeError: module 'tensorflow' has no attribute 'Summary'分析错误原因
06-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值