本文整理汇总了VB.NET中System.Xml.XmlDocumentFragment.OwnerDocument属性的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlDocumentFragment.OwnerDocument属性的具体用法?VB.NET XmlDocumentFragment.OwnerDocument怎么用?VB.NET XmlDocumentFragment.OwnerDocument使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了XmlDocumentFragment.OwnerDocument属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Sample
Option Explicit
Option Strict
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
' Create the XmlDocument.
Dim doc As New XmlDocument()
doc.LoadXml("<items/>")
' Create a document fragment.
Dim docFrag As XmlDocumentFragment = doc.CreateDocumentFragment()
' Display the owner document of the document fragment.
Console.WriteLine(docFrag.OwnerDocument.OuterXml)
' Add nodes to the document fragment. Notice that the
' new element is created using the owner document of
' the document fragment.
Dim elem As XmlElement = doc.CreateElement("item")
elem.InnerText = "widget"
docFrag.AppendChild(elem)
Console.WriteLine("Display the document fragment...")
Console.WriteLine(docFrag.OuterXml)
End Sub
End Class