WriteWhitespace (IXmlWriterLite)

 

Writes out the specified white space.

Syntax

  
HRESULT WriteWhitespace (const WCHAR * whitespace);  

Arguments

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

Return Value

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. In contrast, if the parameter is an empty string, the value written is "".

The following example 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;  
}  

For a complete code example that uses WriteWhitespace, see Universal Windows Platform (UWP) XmlLite sample.

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

IXmlWriterLite Methods