Microsoft XML Core Services (MSXML) 4.0 - SOM Reference

particles Property

Returns a collection of some combination of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny.

The types of items in the collection are specified in the itemType property of the ISchemaItem interface. The following table shows each itemType and its corresponding collection content.

ISchema.itemType value Content objects
SOMITEM_ALL A collection of one or more ISchemaElement objects.
SOMITEM_CHOICE A collection of one or more of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny. Each of these objects can occur zero or more times in the collection.
SOMITEM_SEQUENCE A collection of one or more of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny. Each of these objects can occur zero or more times in the collection.

[Script]

Implementation Syntax

var oParticles = oISchemaModelGroup.particles;

Parameters

None.

Return Values

oParticles
An object. The ISchemaItemCollection object of one or more of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny, if any.

Example

The following snippet is taken from the Walk the SOM sample application. In this snippet, the particles object is retrieved from the ISchemaModelGroup object. The items of the particles object are accessed using the ISchemaItemCollection interface. To see the snippet in the application code, click here.

    For Each item in poGroup.particles
        If item.itemType = SOMITEM_ELEMENT Then
            res = res + printElement(item, t+1)
        End If
        If (item.itemType and SOMITEM_GROUP) = SOMITEM_GROUP Then
            res = res + processGroup(item, t+1)+vbNewline
        End If
        If item.itemType = SOMITEM_ANY Then
            res = res + "any: " + item.name+vbNewline
        End If
    Next
[Visual Basic]

Implementation Syntax

Set oParticles = oISchemaModelGroup.particles 

Parameters

None.

Return Values

oParticles
An object. The ISchemaItemCollection object of one or more of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny, if any.
[C/C++]

Implementation Syntax

HRESULT get_particles(ISchemaItemCollection** particles);

Parameters

particles [out,retval]
An object. The ISchemaItemCollection object of one or more of the following objects: ISchemaElement, ISchemaModelGroup, and ISchemaAny, if any.

Return Values

S_OK
The value returned if successful.
E_POINTER
The value returned if the particles object is NULL
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.

See Also

ISchemaElement Interface | ISchemaComplexType contentModel Property | ISchemaAny Interface | ISchemaItem itemType Property

Applies to: ISchemaModelGroup Interface

This HTML Help has been published using the chm2web software.