vb System.Xml.IHasXmlNode类(方法)实例源码

下面列出了vb System.Xml.IHasXmlNode 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Xm   
' 导入命名空间
Imports System.IO
Imports System.Xml
Imports System.Xml.XPath

public class Sample

  public shared sub Main()

     Dim doc as XmlDocument = new XmlDocument()
     doc.Load("books.xml")
                         
     ' Create an XPathNavigator and select all books by Plato.
     Dim nav as XPathNavigator = doc.CreateNavigator()
     Dim ni as XPathNodeIterator = nav.Select("descendant::book[author/name='Plato']")
     ni.MoveNext()

     ' Get the first matching node and change the book price.
     Dim book as XmlNode = CType(ni.Current, IHasXmlNode).GetNode()
     book.LastChild.InnerText = "12.95"
     Console.WriteLine(book.OuterXml)
    
  end sub
end class


问题


面经


文章

微信
公众号

扫码关注公众号