XProcessingInstruction.Data 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 or sets the string value of this processing instruction.
public:
property System::String ^ Data { System::String ^ get(); void set(System::String ^ value); };
public string Data { get; set; }
member this.Data : string with get, set
Public Property Data As String
Property Value
A String that contains the string value of this processing instruction.
Exceptions
The string value
is null
.
Examples
The following example uses the Data property to retrieve the string value of a processing instruction.
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)
This example produces the following output:
type='text/xsl' href='hello.xsl'
type='text/xsl' href='xform.xsl'
Remarks
You can use this property to modify an XML tree. This property will cause events to occur.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om