XmlProcessingInstruction::Target Property

 

Gets the target of the processing instruction.

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

public:
property String^ Target {
	String^ get();
}

Property Value

Type: System::String^

The target of the processing instruction.

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: