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

minOccurs Property

Returns a variant of type VT_BSTR that represents the minimum number of times that an item can occur in a document. A value of zero indicates that the item is optional.

Example

The following is an example of the minOccurs attribute used in an XML Schema.

<schema xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType name="someelement">
      <choice>
         <element name="book" minOccurs="1" maxOccurs="4"/>
         <element name="magazine" minOccurs="1" maxOccurs="1"/>
      </choice>
   </complexType>
</schema>
[Script]

Implementation Syntax

var varMinOccurs = oISchemaParticle.minOccurs;

Parameters

None.

Return Values

varMinOccurs
A variant. The minimum number of times the item can appear in an instance document of this XML Schema document. Zero is returned if the item is optional.
[Visual Basic]

Implementation Syntax

varMinOccurs = oISchemaParticle.minOccurs

Parameters

None.

Return Values

varMinOccurs
A variant. The minimum number of times the item can appear in an instance document of this XML Schema document. Zero is returned if the item is optional.
[C/C++]

Implementation Syntax

HRESULT get_minOccurs(VARIANT* minOccurs);

Parameters

minOccurs [out,retval]
A variant. The minimum number of times the item can appear in an instance document of this XML Schema document. Zero is returned if the item is optional.

Return Values

S_OK
The value returned if successful.
E_POINTER
The value returned if the minOccurs parameter is NULL.

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.

See Also

ISchemaParticle maxOccurs Property | element Element

Applies to: ISchemaParticle Interface