Share via


WriteName (Compact 7)

3/12/2014

This method writes out the specified name. This guarantees that the name is valid according to the XML specification.

Syntax

HRESULT WriteName (
    const WCHAR* pwszName
);

Arguments

  • pwszName
    The name to write. NULL is not valid.

Return Value

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

Remarks

WriteName guarantees 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;
}

See Also

Reference

IXmlWriter Methods
IXmlWriter Properties