XML_GetElementAttribute Function

Description:

The XML_GetElementAttribute function returns a XML attribute content.
The XML tag location containing the XML attribute to be retrieved can be specified by:

Format:

HTTP GET HOST Hostname URL url szVar = XML_GetElementAttribute(options, tag, tagIndex, attribute);
HTTP GET HOST Hostname URL url szVar = XML_GetElementAttribute(options, path, attribute);
szVar = XML_GetElementAttribute(inputXML, tag, tagIndex, attribute);
szVar = XML_GetElementAttribute(inputXML, path, attribute);

Parameters:

szVar

A string variable into which the attribute value will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

tag

A string expression containing the name of the XML tag (without '<' and '>') which contains the attribute to retrieve.

tagindex

An integer expression containing the XML tag index in the XML document.

path

A string expression containing the path of the XML tag (tag(tagnum){/tag(tagnum)}) which contains the attribute to retrieve.

attribute

A string expression containing the name of the attribute whose value must be found.

inputXML

A string expression containing XML from which the function will extract a specified tag attribute.

Example:

STRING szVar;
STRING szHTML;

HTTP GET HOST "localhost" URL "/data.xml" szVar = XML_GetElementAttribute(content, "OUT_IDENT_CTR_ABN", 1, "SRC");
HTTP GET HOST "localhost" URL "/data.xml" szVar = XML_GetElementAttribute(content, "/BRSBDT1[1]/OUT_DATA[1]/OUT_IDENT_CTR_ABN[1]","SRC");

HTTP GET HOST "localhost" URL "/data.xml" szXML = GetContent();
szVar = XML_GetElementAttribute(szXML, "OUT_IDENT_CTR_ABN", 1, "SRC");
szVar = XML_GetElementAttribute(szXML, "/BRSBDT1[1]/OUT_DATA[1]/OUT_IDENT_CTR_ABN[1]","SRC");

See also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap