Expand Minimize

WsFindAttribute function

Searches the attributes of the current element for an attribute with the specified name and namespace and returns its index which may be passed to WsReadStartAttribute.

Syntax


HRESULT WINAPI  WsFindAttribute(
  _In_      WS_XML_READER* reader,
  _In_      const WS_XML_STRING* localName,
  _In_      const WS_XML_STRING* ns,
  _In_      BOOL required,
  _Out_     ULONG* *attributeIndex,
  _In_opt_  WS_ERROR* error
);

Parameters

reader [in]

The reader on which to find the attribute.

localName [in]

The local name of the attribute to search for.

ns [in]

The namespace of the attribute to search for.

required [in]

If required is TRUE and the attribute is not found, the function will return WS_E_INVALID_FORMAT. (See Windows Web Services Return Values.) if required is FALSE and the attribute is not found, the function will return S_FALSE.

attributeIndex [out]

If the attribute is found, then the index of the attribute, is returned here. This index can then be passed to WsReadStartAttribute.

error [in, optional]

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

Return value

This function can return one of these values.

Return codeDescription
WS_E_INVALID_FORMAT

The input data was not in the expected format or did not have the expected value.

 

Remarks

If the reader is not positioned on a start element then it will return WS_E_INVALID_OPERATION. (See Windows Web Services Return Values.)

The index returned does not necessarily correspond to the position of the attribute as it appeared in the document. It identifies the index of the matching attribute in the array of attributes of the WS_XML_ELEMENT_NODE. The order of the attributes in this array may differ from the order in which the attributes appeared in the document.

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