XML_GetElementText Function

Description:

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

Format:

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

Parameters:

szVar

A string variable into which the text 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 text 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 text to retrieve.

textIndex

A integer expression containing the index of the text in the tag specified by the above parameters.

inputXML

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

Example:

STRING szVar;
STRING szXML;

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

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

See also:





Go back to the Learning center:


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