如何加载一个文档中的一个节点进行操作,然后把结果存回去呢?
如:
<a>
  <b>hh</b>
</a>
<c>
  <d></d>
</c>
如何只操作a或只操作c,不影响另外一个节点呢?

解决方案 »

  1.   

    参照下面的函数,没用的就给删掉.
        Public Function GetXmlData(ByVal tagName As String, _
                               ByVal childTagName As String, _
                               ByVal attributeName As String) As String        Dim doc As New XmlDocument
            Dim node As XmlNode
            Dim value As String        doc.Load(configPath)
            Try
                node = doc.GetElementsByTagName(tagName).Item(0)
                value = node.SelectSingleNode(childTagName).Attributes(attributeName).Value
            Catch e As Exception
                Return ""
            End Try        Return value    End Function
      

  2.   

    http://blog.csdn.net/lizanhong/archive/2004/06/23/24374.aspx