XML_GetElement Function

Description:

The XML_GetElement function return an XML tag content. 
The tag location can be specified by:

Format:

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

Parameters:

szVar

A string variable into which the tag content 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 '>') to be retrieved.

tagindex

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

path

A string expression containing the path of the XML tag (tag(tagnum){/tag(tagnum)}).

inputXML

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

Example:

STRING szVar;
STRING szXML;

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

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

See also:





Go back to the Learning center:


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