WriteProcessingInstruction()

XmlTextWriter::WriteProcessingInstruction(String, String) method

Writes out a processing instruction with a space between the name and text as follows: <?name text?>.

void System::Xml::XmlTextWriter::WriteProcessingInstruction(String name, String text) override

Arguments

ParameterTypeDescription
nameStringName of the processing instruction.
textStringText to include in the processing instruction.

Exceptions

ExceptionDescription
ArgumentExceptionThe text would result in a non-well formed XML document. name is either nullptr or String::Empty.

Remarks

This method is being used to create an XML declaration after XmlTextWriter::WriteStartDocument has already been called.

See Also