Bagikan melalui


XProcessingInstruction.NodeType Properti

Definisi

Mendapatkan jenis node untuk simpul ini.

public:
 virtual property System::Xml::XmlNodeType NodeType { System::Xml::XmlNodeType get(); };
public override System.Xml.XmlNodeType NodeType { get; }
member this.NodeType : System.Xml.XmlNodeType
Public Overrides ReadOnly Property NodeType As XmlNodeType

Nilai Properti

Jenis node. Untuk XProcessingInstruction objek, nilai ini adalah ProcessingInstruction.

Contoh

Contoh berikut membuat instruksi pemrosesan, lalu mencetak jenis nodenya.

XProcessingInstruction pi =
    new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"hello.xsl\"");
Console.WriteLine(pi.NodeType);
Dim pi As XProcessingInstruction = _
    <?xml-stylesheet type="text/xsl" href="hello.xsl"?>
Console.WriteLine(pi.NodeType.ToString)

Contoh ini menghasilkan output berikut:

ProcessingInstruction

Keterangan

Karena semua kelas yang berasal dari XObject berisi NodeType properti, Anda dapat menulis kode yang beroperasi pada koleksi subkelas konkret .XObject Kode Anda kemudian dapat menguji jenis node dari setiap simpul dalam koleksi.

Berlaku untuk

Lihat juga