webservices: Implement WsReadStartAttribute.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-01-29 13:27:29 +01:00 committed by Alexandre Julliard
parent 5eed03cb28
commit bd4361cb0f
2 changed files with 25 additions and 1 deletions

View File

@ -378,6 +378,7 @@ enum reader_state
READER_STATE_INITIAL,
READER_STATE_BOF,
READER_STATE_STARTELEMENT,
READER_STATE_STARTATTRIBUTE,
READER_STATE_STARTENDELEMENT,
READER_STATE_TEXT,
READER_STATE_ENDELEMENT,
@ -393,6 +394,7 @@ struct reader
enum reader_state state;
struct node *root;
struct node *current;
ULONG current_attr;
WS_XML_READER_INPUT_TYPE input_type;
const unsigned char *input_data;
ULONG input_size;
@ -1341,6 +1343,28 @@ HRESULT WINAPI WsMoveReader( WS_XML_READER *handle, WS_MOVE_TO move, BOOL *found
return read_move_to( reader, move, found );
}
/**************************************************************************
* WsReadStartAttribute [webservices.@]
*/
HRESULT WINAPI WsReadStartAttribute( WS_XML_READER *handle, ULONG index, WS_ERROR *error )
{
struct reader *reader = (struct reader *)handle;
WS_XML_ELEMENT_NODE *elem;
TRACE( "%p %u %p\n", handle, index, error );
if (error) FIXME( "ignoring error parameter\n" );
if (!reader) return E_INVALIDARG;
elem = &reader->current->hdr;
if (reader->state != READER_STATE_STARTELEMENT || index >= elem->attributeCount)
return WS_E_INVALID_FORMAT;
reader->current_attr = index;
reader->state = READER_STATE_STARTATTRIBUTE;
return S_OK;
}
static WCHAR *xmltext_to_widechar( WS_HEAP *heap, const WS_XML_TEXT *text )
{
WCHAR *ret;

View File

@ -118,7 +118,7 @@
@ stub WsReadMetadata
@ stdcall WsReadNode(ptr ptr)
@ stub WsReadQualifiedName
@ stub WsReadStartAttribute
@ stdcall WsReadStartAttribute(ptr long ptr)
@ stdcall WsReadStartElement(ptr ptr)
@ stdcall WsReadToStartElement(ptr ptr ptr ptr ptr)
@ stdcall WsReadType(ptr long long ptr long ptr ptr long ptr)