XmlDocumentFragment::InnerXml Property

 

Gets or sets the markup representing the children of this node.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public:
property String^ InnerXml {
	virtual String^ get() override;
	virtual void set(String^ value) override;
}

Property Value

Type: System::String^

The markup of the children of this node.

Exception Condition
XmlException

The XML specified when setting this property is not well-formed.

Setting this property replaces the children of the node with the parsed contents of the given string. The parsing is done in the current namespace context.

This property is a Microsoft extension to the Document Object Model (DOM).

The following example uses the InnerXml property to set the contents of the document fragment.

#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 );
}

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show: