Share via


particles Property

 

[This feature was only implemented for MSXML 6.0.]

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.

JScript 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.

Function processChoiceOrSequence(poGroup, t)
    Dim res As String
    Dim item As ISchemaParticle

    res = ""
    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
    processChoiceOrSequence = res
End Function

Visual Basic 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++ 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.

Versioning

Implemented in: MSXML 6.0

Applies to

ISchemaModelGroup Interface

See Also

ISchemaElement Interface
contentModel Property
ISchemaAny Interface
itemType Property1