XmlDocumentFragment.InnerXml Vlastnost

Definice

Získá nebo nastaví značky 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

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

Výjimky

Xml zadaný při nastavení této vlastnosti není správně formátován.

Příklady

Následující příklad používá InnerXml vlastnost k nastavení obsahu fragmentu dokumentu.

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 jmenného prostoru.

Tato vlastnost je rozšířením Microsoftu pro model DOM (Document Object Model).

Platí pro