WsGetReaderNode function (webservices.h)

The function returns the XML node at the current position of the XML reader.

Syntax

HRESULT WsGetReaderNode(
  [in]           WS_XML_READER     *xmlReader,
                 const WS_XML_NODE **node,
  [in, optional] WS_ERROR          *error
);

Parameters

[in] xmlReader

A pointer to the reader for which the current node will be obtained. This must be valid WS_XML_READER object.

node

A reference to a WS_XML_NODE structure where the current node is returned.

[in, optional] error

A pointer to a WS_ERROR object where additional information about the error 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.

Remarks

The nodeType field of the node node should be inspected to determine the kind of node returned. The node may then be cast to the appropriate data structure to get the data.

WS_XML_NODE* node;
if (SUCCEEDED(WsGetReaderNode(reader, &node, error)))
{
    if (node->nodeType == WS_XML_NODE_TYPE_ELEMENT)
    {
        WS_XML_ELEMENT_NODE* elementNode = (WS_XML_ELEMENT_NODE*) node;
        // Refer to elementNode->localName, elementNode->ns
    }
}

The nodeTypes with extended structures include:

The node returned should not be modified and is only valid until the reader advances. For the attributes in a WS_XML_ELEMENT_NODE callers should not expect the attributes to appear in any particular order.

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