Salesforce

XMLFind (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XMLFind (Magic xpa 3.x)

Returns the index of an XML element that has a value equal to a specified value. The function also returns the index if one of its attribute values is equal to a specified value.

Syntax:

XMLFind (generation, device, element path, element name, num, child element name/attribute name, value, [begin at])

Parameters:

generation: A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on.

device: A number that represents the sequence number of the I/O device in the current task.

element path: A string that represents the path of an XML element. The syntax is:
/element name[
[index]] [/element name[[index]]...]

where:

element name is the name of an XML element. You can assign an alias to the element name. The alias is separated from the element name by a colon symbol (:), for example, al1:My_Element.

index is the index of a specified occurrence of an element that has multiple occurrences. The index value must be greater than 0. Negative values are invalid.

element name: A name of an XML element that has multiple occurrences under the specified element path.

num: A numeric value. 0 means that the next parameter is a child element name and 1 means that the next parameter is an attribute name. as shown below:

  • child element name: If you have entered 0 for the num parameter, you must specify the name of an XML element that is the child element of the multi-occurrence element name. The child element name value is compared to the value parameter. If the Value parameter string is empty, the value will be compared to the value of the multi-occurrence element name. If you have specified a child element name, the attribute name parameter must be empty.

  • attribute name: If you have entered 1 for the num parameter, you must specify the name of an XML attribute that is the attribute of the multi-occurrence element name. Its value is compared to the Value parameter. If you have specified an attribute name, the child element name parameter must be empty.

value: A string that contains the value to which the child element name and the attribute name is compared.

begin at: You can determine where the index starts in the element path for the Find operation. The default value starts at the first XML element occurrence in the element path.

Returns:

The index of the XML element that can have multiple occurrences. If the XML parsing process was not completed or the requested element does not exist, a 0 value is returned.

Exceptions:

This function is not supported for Rich Client tasks.

Example:

XMLFind Example

See also:

XML Namespaces

XML Error Codes

The Online and Rich Client Samples projects (program XM12 and RXM12)

Reference
Attachment 
Attachment