Enables the caller to write out raw markup manually. You can avoid creating entities for special characters by using this method.

HRESULT WriteRaw (WCHAR * pwszData);  

The data to write. Writes nothing if NULL.

Returns S_OK if no error is generated.

If pwszData is NULL, nothing is written. In contrast, if this parameter is an empty string, an empty text entry is written. That is, the value written is "".

The following code shows the use of WriteRaw:

if (FAILED(hr = pWriter->WriteRaw(L"<elementWrittenRaw/>")))  
    wprintf(L"Error, Method: WriteRaw, error is %08.8lx", hr);  
    return -1;  

For a more detailed example of the WriteRaw method, see Write an XML Document using XmlLite.

Note that the writer will not check whether the written text is well-formed XML in the current context.

Header: XmlLite.h

Library: XmlLite.lib

IXmlWriter Methods