XMLElementsColl Object

Description

An object representing a collection of XML elements. This object can be accessed using one of the following methods or properties:

Properties

Method AllItemsByNameReturns a collection of elements with the specified name.
CountReturns the number of elements in the collection.
ItemReturns the specified element from the collection.
ItemByNameReturns the element with the specified tag name. If more than one item has the same tag name, you can specify which occurrence of the tag name you want to retrieve.

Back to top

AllItemsByName Property

Description

Returns a collection of elements with the specified name.

Syntax

XMLElementsColl.AllItemsByName ( Name )

Argument

Type

Description

Name

String

The element name you want to find.

Return Value

XMLElementsColl Object

IMPORTANT

The returned item collection is a copy of the specified items. Therefore, any changes you make to the original element collection after retrieving this collection (such as adding or removing an item with the specified name) are not included. For example, if you use the Count property on the returned item collection, the returned value is the same before and after adding or removing elements to or from the original collection. To ensure that the collection is up-to-date after changes are made, use the AllItemsByName property again to retrieve the updated collection.

Back to top

Count Property

Description

Returns the number of elements in the collection.

Syntax

XMLElementsColl.Count

Return Value

Number

Back to top

Item Property

Description

Returns the specified element from the collection.

Syntax

XMLElementsColl.Item (ID, [Index] )

Argument

Type

Description

ID

Variant

The name (with quotes) of the element to return, or a numeric index (with or without quotes) that denotes the position of the item in the collection. The first item in a collection is numbered 1.

Index

String

Optional. If you specify an element name for the ID argument, you can specify which occurrence of the name you want to find and return. If no index value is specified with an element name, the first occurrence of the element with the specified name is returned.

Return Value

XMLElement Object

Back to top

ItemByName Property

Description

Returns the element with the specified tag name. If more than one item has the same tag name, you can specify which occurrence of the tag name you want to retrieve. If not specified, the first occurrence is retrieved.

Syntax

XMLElementsColl.ItemByName (Tag, [Index])

Argument

Type

Description

Tag

String

The tag name of the element to return.

Index

Number

Optional. The occurrence of the tag name to use.

Return Value

XMLElement Object


.