Windows Dev Center


Writes out the specified name, ensuring that the name is valid according to the XML specification.

HRESULT WriteName (const WCHAR * pwszName);


The name to write.. NULL is invalid.

Returns S_OK if no error is generated. Returns an error if pwszName is NULL or the name is not valid. An example of an invalid name is one that starts with a colon (":").

WriteName ensures that the name is valid according to the Namespaces in XML specification.

The following code shows the use of WriteName:

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

For a more detailed example of WriteName, see Writing an XML Document Using XmlLite.

Header: XmlLite.h

Library: XmlLite.lib

© 2015 Microsoft