2.15 .attribute[integer]

The attribute serves, according to the indexing, for calling up the name or the value of an attribute within the DOM nodes.

If the index is a number, then the name of the corresponding attribute of the DOM node will be delivered. Please note, attributes of a DOM node are primarily unsorted. If the index is a string, then the attribute will display the name of the attribute and it will receive the value of the attribute in return.

Definition

  • Data type

    integer

    string, object [ text ]

  • Access

    get

    set (only with string index)

  • changed event

    no

An assignment to the attribute, which is indexed with a string, will result in the allocation of a corresponding attribute to the DOM nodes. The assignment of an empty string deletes the corresponding attribute of the DOM nodes. It is not allowed to assign an attribute that is indexed with a number.

The attribute is available for the XML Cursor, but it cannot be passed on. Please note, an XML Cursors, whose attribute .mapped possesses the value false, will automatically be positioned to the root of the DOM document.

Example

The attribute OrderNumber of the XML element, upon which the XML Cursor points, will be set with the following instruction to the value 0815:

this.attribute["OrderNumber"] := "0815";

All attributes of the XML elements, upon which the XML Cursor points, can be given as follows:

variable integer I;
variable string  Name;

for I := 1 to this.count[.attribute] do
  Name := this.attribute[I];
  print Name + " = " + this.attribute[Name];
endfor