DOM GET XML ATTRIBUTE BY INDEX

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2004 (Modified)


DOM GET XML ATTRIBUTE BY INDEX (elementRef; attribIndex; attribName; attribValue)

ParameterTypeDescription
elementRefStringXML element reference
attribIndexLongintAttribute index number
attribNameVariableAttribute name
attribValueVariableAttribute value

Description

The DOM GET XML ATTRIBUTE BY INDEX command is used to get the name of an attribute specified by its index number as well as its value.

Pass the reference of an XML element in elementRef and the index number of the attribute that you want to know the name of in attribIndex. The name is returned in the attribName parameter and its value is returned in the attribValue, parameter. 4th Dimension will attempt to convert the value obtained into the same type as that of the variable passed as parameter.

Note: The index number does not correspond to the location of the attribute in the XML file displayed in text form. In XML, the index of an attribute indicates it position among the attributes when placed in alphabetical order (based on their names). For an illustration of this, refer to the example of the DOM Count XML attributes command.

If the value passed in attribIndex is greater than the number of attributes present in the XML element, an error is returned.

Example

Refer to the example in the DOM Count XML attributes command.

See Also

DOM GET XML ATTRIBUTE BY NAME.

System Variables or Sets

If the command has been correctly executed, the system variable OK is set to 1. If an error occurs, it is set to 0.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next