Share via


defaultValue Property1

 

[This feature was only implemented for MSXML 6.0.]

Returns a string. This string is the default value of the attribute being queried. The <attribute> declaration includes the default attribute.

The following is an example of a default attribute in an XML Schema.

<schema>

<element name="someelement">

<attribute name="someattribute" default="attr text" type="string"/>

</element>

</schema>

JScript Syntax

var strDefaultValue = oISchemaAttribute.defaultValue;  

Parameters

None.

Return Values

strDefaultValue
A string. The value of the default attribute.

Example

The following snippet is taken from the Walk the SOM sample application. In this snippet, the defaultValue property is retrieved from the ISchemaAttribute object.

        If oAttr.defaultValue <> "" Then
            printAttr = printAttr + " default='" + oAttr.defaultValue + "'"
        End If

Visual Basic Syntax

strDefaultValue = oISchemaAttribute.defaultValue  

Parameters

None.

Return Values

strDefaultValue
A string. The value of the default attribute.

C/C++ Syntax

HRESULT get_defaultValue(BSTR* defaultValue);  

Parameters

defaultValue[out,retval]
A string. The value of the default attribute.

Return Values

S_OK
The value returned if successful.

E_POINTER
The value returned if the defaultValue parameter is NULL.

E_FAIL
The value returned if something else is wrong.

Versioning

Implemented in: MSXML 6.0

Applies to

ISchemaAttribute Interface

See Also

element Element