When using XPCML to pass in array data, you must use the count attribute:
The following example illustrates how to pass in arrays of parameter values by using structParm array data and an array of structs.
<?xml version="1.0" encoding="UTF-8"?> <xpcml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xpcml.xsd" version="4.0"> <struct name="s1" > <stringParm name="s1p1"/> <struct name="s1Array"> <stringParm name="s1Ap1"/> </struct> </struct> <struct name="s2"> <stringParm name="s2p1"/> </struct> <program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"> <parameterList> <structParm name="s1Ref" struct="s1" passDirection="in" > <stringParm name="s1p1">Value 1</stringParm> <arrayOfStruct name="s1Array" count="2"> <struct_i> <stringParm name="s1Ap1">Value 1</stringParm> </struct_i> <struct_i> <stringParm name="s1Ap1">Value 2</stringParm> </struct_i> </arrayOfStruct> </structParm> <arrayOfStructParm name="s2Ref" struct="s2" count="2" passDirection="in" > <struct_i> <stringParm name="s2p1">Value 1</stringParm> </struct_i> <struct_i> <stringParm name="s2p1">Value 2</stringParm> </struct_i> </arrayOfStructParm> </parameterList> </program> </xpcml>
For example, the following XPCML specifies an array of 3 intParms and sets the first element to 12, the second to 100, and the third to 4:
<?xml version="1.0" ?> <xpcml version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='xpcml.xsd' > <program name="prog1" path="/QSYS.lib/MYLIG.lib/PROG1.pgm"> <parameterList> <arrayOfIntParm name="intArray" count="3"> <i>12</i> <i>100</i> <i>4</i> </arrayOfIntParm> </parameterList> </program> </xpcml>
You can use the index attribute of the <i> and <struct_i> tags to help you set array values. In the following example, the XPCML sets the first element of the array to 4, the second to 100, and the third to 12.
<?xml version="1.0" ?> <xpcml version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='xpcml.xsd' > <program name="prog1" path="/QSYS.lib/MYLIG.lib/PROG1.pgm"> <parameterList> <arrayOfIntParm name="intArray" count="3"> <i index="2">12</i> <i index="1">100</i> <i index="0">4</i> </arrayOfIntParm> </parameterList> </program> </xpcml>