Expand Minimize

WsGetReaderNode function

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

Syntax


HRESULT WINAPI WsGetReaderNode(
  _In_      WS_XML_READER *xmlReader,
  const WS_XML_NODE **node,
  _In_opt_  WS_ERROR *error
);

Parameters

xmlReader [in]

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.

error [in, optional]

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 codeDescription
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

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

WebServices.h

Library

WebServices.lib

DLL

WebServices.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft