WsGetXmlAttribute function (webservices.h)

Finds the nearest xml attribute in scope with the specified localName and returns its value.
The returned value is placed on the specified heap.

Syntax

HRESULT WsGetXmlAttribute(
  [in]           WS_XML_READER       *reader,
  [in]           const WS_XML_STRING *localName,
  [in]           WS_HEAP             *heap,
                 WCHAR               **valueChars,
  [out]          ULONG               *valueCharCount,
  [in, optional] WS_ERROR            *error
);

Parameters

[in] reader

The reader for which the xml attribute will be searched.

[in] localName

The localName of the xml attribute for which to search.

[in] heap

The heap on which the resulting value should be allocated.

valueChars

The value of the attribute is stored here.

[out] valueCharCount

The length of the valueChars.

[in, optional] error

Specifies where additional error information should be stored if the function fails.

Return value

This function can return one of these values.

Return code Description
E_INVALIDARG
One or more arguments are invalid.
S_FALSE
The xml attribute was not found.

Remarks

This function may only be used to obtain the values of attributes in scope that use the prefix "xml".

If no matching xml attribute is found, a zero length string will be returned for the value, and the function returns S_FALSE.

The reader does not do anything with xml attributes other than to surface them for inspection.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll