4D v13.4

DOM GET XML ATTRIBUTE BY INDEX

Home

 
4D v13.4
DOM GET XML ATTRIBUTE BY INDEX

DOM GET XML ATTRIBUTE BY INDEX 


 

DOM GET XML ATTRIBUTE BY INDEX ( elementRef ; attribIndex ; attribName ; attribValue ) 
Parameter Type   Description
elementRef  String in XML element reference
attribIndex  Longint in Attribute index number
attribName  Variable in Attribute name
attribValue  Variable in Attribute value

The DOM GET XML ATTRIBUTE BY INDEX command gets 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. 4D attempts 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.

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

 
PROPERTIES 

Product: 4D
Theme: XML DOM
Number: 729

The OK variable is changed by the commandThis command modifies the Error system variable

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D 2004

 
SEE ALSO 

DOM GET XML ATTRIBUTE BY NAME
DOM REMOVE XML ATTRIBUTE