The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
XmlDocumentFragment::InnerXml Property
.NET Framework (current version)
Gets or sets the markup representing the children of this node.
Assembly: System.Xml (in System.Xml.dll)
public: property String^ InnerXml { virtual String^ get() override; virtual void set(String^ value) override; }
| 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
Available since 10
.NET Framework
Available since 1.1
Show: