Windows apps
Collapse the table of content
Expand the table of content
Information
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.

XmlProcessingInstruction::Data Property

 

Gets or sets the content of the processing instruction, excluding the target.

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

public:
property String^ Data {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

The content of the processing instruction, excluding the target.

The following example creates a processing instruction node and adds it to a document.

#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
   XmlDocument^ doc = gcnew XmlDocument;

   // Create a procesing instruction.
   XmlProcessingInstruction^ newPI;
   String^ PItext = "type='text/xsl' href='book.xsl'";
   newPI = doc->CreateProcessingInstruction( "xml-stylesheet", PItext );

   // Display the target and data information.
   Console::WriteLine( "<?{0} {1}?>", newPI->Target, newPI->Data );

   // Add the processing instruction node to the document.
   doc->AppendChild( newPI );
}

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