XmlDocumentFragment.InnerXml Vlastnost

Definice

Získá nebo nastaví revize představující podřízené položky tohoto uzlu.

public:
 virtual property System::String ^ InnerXml { System::String ^ get(); void set(System::String ^ value); };
public override string InnerXml { get; set; }
member this.InnerXml : string with get, set
Public Overrides Property InnerXml As String

Hodnota vlastnosti

String

Kód podřízených položek tohoto uzlu.

Výjimky

Xml zadaný při nastavení této vlastnosti není správně vytvořen.

Příklady

Následující příklad používá InnerXml vlastnost nastavit obsah fragmentu dokumentu.

#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
   
   // Create the XmlDocument.
   XmlDocument^ doc = gcnew XmlDocument;
   
   // Create a document fragment.
   XmlDocumentFragment^ docFrag = doc->CreateDocumentFragment();
   
   // Set the contents of the document fragment.
   docFrag->InnerXml = "<item>widget</item>";
   
   // Display the document fragment.
   Console::WriteLine( docFrag->InnerXml );
}
using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {
    // Create the XmlDocument.
    XmlDocument doc = new XmlDocument();

    // Create a document fragment.
    XmlDocumentFragment docFrag = doc.CreateDocumentFragment();

    // Set the contents of the document fragment.
    docFrag.InnerXml ="<item>widget</item>";

    // Display the document fragment.
    Console.WriteLine(docFrag.InnerXml);
  }
}
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()
        
        ' Create a document fragment.
        Dim docFrag As XmlDocumentFragment = doc.CreateDocumentFragment()
        
        ' Set the contents of the document fragment.
        docFrag.InnerXml = "<item>widget</item>"
        
        ' Display the document fragment.
        Console.WriteLine(docFrag.InnerXml)
    End Sub
End Class

Poznámky

Nastavení této vlastnosti nahradí podřízené položky uzlu parsovaným obsahem daného řetězce. Analýza se provádí v aktuálním kontextu oboru názvů.

Tato vlastnost je rozšíření Microsoftu pro model objektu dokumentu (DOM).

Platí pro