RXmlEngXPathResult Class Reference

#include <xml/dom/xmlengxpathresult.h>

class RXmlEngXPathResult
Public Member Enumerations
enumTXmlEngXPathResultType { EUndefined, ENodeset, EBoolean, ENumber, EString }
Public Member Functions
RXmlEngXPathResult()
IMPORT_C TBoolAsBoolean()
IMPORT_C RXmlEngNodeSetAsNodeSet()
IMPORT_C TRealAsNumber()
IMPORT_C voidAsStringL(RBuf8 &)
voidClose()
IMPORT_C voidFree()
IMPORT_C TXmlEngXPathResultTypeType()

Detailed Description

Represents the result of a XPath expression.

The result may be one of the standard types: string, boolean, number (float), node set or be undefined in the case of error.

The returned result should be freed after use.

Member Enumeration Documentation

Enum TXmlEngXPathResultType

Result types of a XPath expression. See http://w3.org/TR/xpath#section-Introduction

EnumeratorValueDescription
EUndefined0
ENodeset1
EBoolean2
ENumber3
EString4

Constructor & Destructor Documentation

RXmlEngXPathResult ( )

IMPORT_CRXmlEngXPathResult()

Default constructor

Member Function Documentation

AsBoolean ( )

IMPORT_C TBoolAsBoolean()const

Retrieves a boolean result. Conversion can occur from other types.

Numbers will be returned as true unless it is not a number or 0.0. A string of 0 length will return false, otherwise true. If the node exists it will be returned as true, otherwise false.

Return Value
Boolean value of the result

AsNodeSet ( )

IMPORT_C RXmlEngNodeSetAsNodeSet()const

Retrieves a node-set result. A Non-RXmlEngNodeSet result will return NULL. No conversion is done from other types.

For more information no NULL nodes:

See also: TXmlEngNode

Return Value
Node-set result

AsNumber ( )

IMPORT_C TRealAsNumber()const

Retrieves a numeric value result. Conversion can occur from other types.

Node sets, strings, and booleans will be cast to numbers. Anything else will return NAN (i.e. not a number).

See also: Math

Return Value
Numeric value of the result.

AsStringL ( RBuf8 & )

IMPORT_C voidAsStringL(RBuf8 &aOutput)const
Retrieves a string copy of result.
Leave Codes
KErrNoMemoryif out of memory situation occurs.

Close ( )

voidClose()[inline]

Frees any allocated memory

Free ( )

IMPORT_C voidFree()

Frees any allocated memory

Type ( )

IMPORT_C TXmlEngXPathResultTypeType()const

Retrieves the type of the result (e.g. boolean, number, string, etc.). The type of a result should always be checked before using the result.

If there was an error and no value was set, undefined is returned. Otherwise nodeset is returned.

See also: TXmlEngXPathResultType

Return Value
Type of result.