一段XML  我怎么获取他的数据   VB6.0<?xml version = "1.0" encoding = "GB2312" standalone = "no"?>
<data>
<book cost="56">
<name>Dreamweaver</name>
</book>
<book cost="62">
<name>Flash</name>
</book>
<book cost="48">
<name>Firweorks</name>
</book>
</data>各位大侠帮帮忙啊!

解决方案 »

  1.   

    XML DOM Methods.
    类似
    Dim oSchemaCache As New XMLSchemaCache40
    Dim oDOMNode As DOMDocument40
    Dim nsTarget As StringnsTarget = ""
    oSchemaCache.Add nsTarget, "po.xsd"
    Set oDOMNode = oSchemaCache.get(nsTarget)
      

  2.   

    xml  读取  一定要  xsd吗?? 有什么方法 好像recodeset一样一条一条读取的吗?
      

  3.   

    <html>
    <title>read xml</title>
    <body>
    <%
    dim node,i,nodecount
    set Doc = CreateObject("Microsoft.XMLDOM")
    Doc.async = false
    Doc.load("http://127.0.0.1/in2.xml") 
    set root = Doc.documentElement
    set nodeLis = root.childNodes
    nodeCount = nodeLis.length
    For i=1 to nodeCount 
    set node = nodeLis.nextNode()
    set cost = node.attributes.getNamedItem("cost")
    %>
    第 <%=i%> 条记录:
    <table border="1">
    <tr> 
    <td width="17">书名</td>
    <td width="48">出版社</td>
    <td width="32">价格</td>
    </tr>
    <tr> 
    <td> 
    <%=node.selectSingleNode("name").text%>
    </td>
    <td> </td>
    <td> 
    <%= cost.text%>
    </td>
    </tr>
    </table>
    <%
    Next
    %>
    </body>
    </html>ASP这样可以读取   在VB里面怎么样实现呢??
      

  4.   

    一样的,还有你的asp代码有问题,容易导致服务器崩溃server.createobject createobject是单机运行
      

  5.   

    你直接把asp代码取出就好了,如果对xmldom有什么不理解的,可以发短消息问我
      

  6.   

    XmlDocument fdoc = New XmlDocument()
    StreamReader fReader = New StreamReader(filepath\filename,System.Text.Encoding.GetEncoding("GB2312"))
    fdoc.Load(fReader)
    Dim nodeList As XmlNodeList
    nodeList = fdoc.SelectNodes(aXPath)
    ....
    ...
    ..