Partager via


WriteWhitespace (Compact 7)

3/12/2014

This method writes out the specified whitespace.

Syntax

HRESULT WriteWhitespace (
  const WCHAR* whitespace
);

Parameters

  • Whitespace
    The white space to write. NULL is valid and indicates that no operation is to be performed.

Return Value

This method returns S_OK if no error is generated.

Remarks

Use this method to manually format an XML document.

When the whitespace parameter is NULL, this method returns S_OK without writing any content. If the parameter is an empty string, the value written is "".

The following code shows the use of WriteWhitespace:

if (FAILED(hr = pWriter->WriteWhitespace(L"\n")))  // Output a newline.
{
    wprintf(L"Error, Method: WriteWhitespace, error is %08.8lx", hr);
    return -1;
}

See Also

Reference

IXmlWriter Methods
IXmlWriter Properties