isValid Method

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SOM Reference

isValid Method

Returns a Boolean true or false. If true, the data sent to the isValid method is valid according to the type definition of the ISchemaType object being queried. If false, the data is not valid.

[Script]

Implementation Syntax

var bolValid = oISchemaType.isValid(strData);

Parameters

strData
A string. The data to be validated.

Return Values

bolValid
A Boolean value. The result of validation of the passed-in data.
[Visual Basic]

Implementation Syntax

bolValid = oISchemaType.isValid(strData)

Parameters

strData
A string. The data to be validated.

Return Values

bolValid
A Boolean value. The result of validation of the passed-in data.
[C/C++]

Implementation Syntax

HRESULT isValid(BSTR data, VARIANT_BOOL* valid);

Parameters

data [in]
A string. The data to be validated.
valid [out,retval]
A Boolean value. The result of validation of the passed-in data.

Return Values

S_OK
The value returned if successful.
S_INVALIDARG
The value returned if the data string is NULL.
S_POINTER
The value returned if the Valid return value is NULL.
S_NOTIMPL
The value returned if itemType property is SOMITEM_DATATYPE_QNAME or SOMITEM_COMPLEXTYPE.
E_FAIL
The value returned if something else is wrong.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

Remarks

Documents containing Qname or NOTATION types or types derived from them cannot be validated currently with XSD. Therefore, validation will fail with E_FAIL and the valid parameter will be returned as VARIANT_TRUE and isValid will return S_FALSE.

See Also

ISchemaItem itemType Property

Applies to: ISchemaType Interface