Defining the Parameter Set
Parameter sets have the form:
Param_1, Param_2, Param_3, ...
where Param is the value either in argument "ValueParam=Param" or in "XmlFragmentParam=Param" .
For example, if the following argument is passed:
"ValueParam=multi_param"
then the function will write the matches it finds into parameters:
multi_param_1, multi_param_2, multi_param_3 ...
With Functions that read a parameter set, the values written to the parameter can then be evaluated. For example, the following code retrieves (using lr.xmlGetValues) and prints out (using lr.evalString) multiple matches of a query:
NumOfValues = lr.xmlGetValues("Xml={XmlParam}", "Query=//string",
"SelectAll=yes", "ValueParam=MultiParam", LAST );
for (i = 0; i < NumOfValues; i++) { /* Print the multiple values of MultiParam */
char buf[1000];
sprintf (buf, "Retrieved value %d : {MultiParam_%d}", i+1);
lr.outputMessage(lr.evalString(buf));
}
For Functions that write to a parameter set, the values of the parameter set must be pre-defined before the function can read from it. The parameter must also be named in the form:
Param_1, Param_2, Param_3, ...
where Param is the value in "Specification=Param".
For example, lr.xmlSetValues reads each value from a parameter set and then sets that value in the XPath match returned by the query. The following code defines a parameter set called "ExtensionParam", which has two members: ExtensionParam_1 and ExtensionParam_2.
lr.xmlSetValues then queries the XML input string and sets the value of the first match returned as "1111" and the second as "2222".
lr.saveString("1111", "ExtensionParam_1");
lr.saveString("2222", "ExtensionParam_2");
lr.xmlSetValues("XML={XML_Input_Param}",
"ResultParam=NewXmlParam", "ValueParam=ExtensionParam",
"SelectAll=yes", "Query=//extension", LAST );