Element Object

Properties Methods Associated objects

The element object stores the information that is associated with an XML element. This includes the content, other elements, PCData, CData... the orderof the content and the attributes associated with that element.

Properties

amountContent

Integer value, (Read only) this returns the number of content objects are stored within this element

attributes

This is a reference to an attributes object, which contains details of all the attributes associated with this element.

content(index as Integer)

Variant, (Read only) Given an index it returns the content at that indent, whose type can be found using the contentType property of the element.

contentType(index as Integer)

contentType value, (Read only) This returns the type of the content at a given index.

Name

String, Sets/Returns the name of the element

Methods

addContent(content as Variant, cType As contentType)

Given content and content type, it adds this content to the content that is already stored within the element as the last bit of content in the element.

setContent(content as Variant, cType As contentType, index as Integer)

Given content, content type and an index this sets the content at that index point to be the given content with the given type.

Associated objects

Attributes (child)

Remark

When using addContent and setContent, xmlParsser assumes that the cType given is in actual fact the type of the content, if not, you may have problems later on with your code expecting an element and getting a string.

There is no type checking on the saving of documents and there is no type checking in the values you put into the name property. This means that you have to check the name is a valid name yourself. It will produce an error when loading an XML document with an element that has an invalid name.