次の方法で共有


WriteNmToken

 

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

Syntax

  
HRESULT WriteNmToken (const WCHAR * pwszNmToken);  

Arguments

pwszNmToken
The name to write. NULL is invalid.

Return Value

Returns S_OK if no error is generated. Returns an error if pwszNmToken is NULL or the name is not a valid NmToken.

Remarks

If NULL is supplied for the name, an error is returned.

The following code shows the use of WriteNmToken:

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

For a more detailed example of WriteNmToken, see Write an XML Document using XmlLite.

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

IXmlWriter Methods