XProcessingInstruction.Data 属性  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置此处理指令的字符串值。
public:
 property System::String ^ Data { System::String ^ get(); void set(System::String ^ value); };public string Data { get; set; }member this.Data : string with get, setPublic Property Data As String属性值
一个 String,其中包含此处理指令的字符串值。
例外
字符串 value 为 null。
示例
以下示例使用 Data 属性检索处理指令的字符串值。
XProcessingInstruction pi =  
    new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'");  
Console.WriteLine(pi.Data);  
pi.Data = "type='text/xsl' href='xform.xsl'";  
Console.WriteLine(pi.Data);  
Dim pi As XProcessingInstruction = <?xml-stylesheet type='text/xsl' href='hello.xsl'?>  
Console.WriteLine(pi.Data)  
pi.Data = "type='text/xsl' href='xform.xsl'"  
Console.WriteLine(pi.Data)  
该示例产生下面的输出:
type='text/xsl' href='hello.xsl'  
type='text/xsl' href='xform.xsl'  
注解
可以使用此属性修改 XML 树。 此属性将导致事件发生。