Share via


WriteElementString (Compact 2013)

3/26/2014

This method writes out an element together with the specified prefix, name, namespace, and value.

Syntax

HRESULT WriteElementString (
  const WCHAR* pwszPrefix,
  const WCHAR* pwszLocalName,
  const WCHAR* pwszNamespaceUri,
  const WCHAR* pwszValue
);

Arguments

  • pwszPrefix
    The namespace prefix of the element. NULL is the same as an empty string.
  • pwszLocalName
    The local name of the element. NULL will result in an error.
  • pwszNameSpaceUri
    The namespace URI of the element. NULL is the same as an empty string.
  • pwszValue
    The value of the element. NULL indicates that there is no content to write. In contrast, an empty string indicates that this element has an empty value.

Return Value

This method returns S_OK if no error is generated.

Remarks

The following code shows using WriteElementString:

if (FAILED(hr = pWriter->WriteElementString(NULL, L"myElement", NULL, L"myValue")))

{

wprintf(L"Error, Method: WriteElementString, error is %08.8lx", hr);

return -1;

}

See Also

Reference

IXmlWriter Methods
IXmlWriter Properties