通过


XProcessingInstruction.Target 属性

定义

获取或设置此处理指令的目标应用程序。

public:
 property System::String ^ Target { System::String ^ get(); void set(System::String ^ value); };
public string Target { get; set; }
member this.Target : string with get, set
Public Property Target As String

属性值

此处理指令的目标应用程序。

例外

字符串 valuenull.

目标不遵循 XML 名称的约束。

示例

以下示例使用 Target 属性检索目标应用程序以执行处理指令。

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

此示例生成以下输出:

xml-stylesheet

适用于

另请参阅