XmlProcessingInstruction.Target Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the target of the processing instruction.
public:
property System::String ^ Target { System::String ^ get(); };
public string Target { get; }
public string? Target { get; }
member this.Target : string
Public ReadOnly Property Target As String
Property Value
The target of the processing instruction.
Examples
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 );
}
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlDocument doc = new 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);
}
}
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
' Create a procesing instruction.
Dim newPI as XmlProcessingInstruction
Dim PItext as String = "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)
end sub
end class
Applies to
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.