ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/rzahhxpcmlexmplregpassarray.htm

114 lines
5.4 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="Examples: Passing in arrays of parameter values as XPCML" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzahhxpcmlexmplregpassarray" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Examples: Passing in arrays of parameter values as XPCML</title>
</head>
<body id="rzahhxpcmlexmplregpassarray"><a name="rzahhxpcmlexmplregpassarray"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Examples: Passing in arrays of parameter values as XPCML</h1>
<div><div class="section"><p>When using XPCML to pass in array data, you must use the count
attribute:</p>
<ul><li>Specify the count attribute on the array element</li>
<li>Set the count attribute to the number of elements that the array contains
at the time you parse the document</li>
</ul>
<p>The following example illustrates how to pass in arrays of parameter
values by using structParm array data and an array of structs.</p>
<pre> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xpcml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xpcml.xsd" version="4.0"&gt;
&lt;struct name="s1" &gt;
&lt;stringParm name="s1p1"/&gt;
&lt;struct name="s1Array"&gt;
&lt;stringParm name="s1Ap1"/&gt;
&lt;/struct&gt;
&lt;/struct&gt;
&lt;struct name="s2"&gt;
&lt;stringParm name="s2p1"/&gt;
&lt;/struct&gt;
&lt;program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;structParm name="s1Ref" struct="s1" passDirection="in" &gt;
&lt;stringParm name="s1p1"&gt;Value 1&lt;/stringParm&gt;
&lt;arrayOfStruct name="s1Array" count="2"&gt;
&lt;struct_i&gt;
&lt;stringParm name="s1Ap1"&gt;Value 1&lt;/stringParm&gt;
&lt;/struct_i&gt;
&lt;struct_i&gt;
&lt;stringParm name="s1Ap1"&gt;Value 2&lt;/stringParm&gt;
&lt;/struct_i&gt;
&lt;/arrayOfStruct&gt;
&lt;/structParm&gt;
&lt;arrayOfStructParm name="s2Ref" struct="s2" count="2" passDirection="in" &gt;
&lt;struct_i&gt;
&lt;stringParm name="s2p1"&gt;Value 1&lt;/stringParm&gt;
&lt;/struct_i&gt;
&lt;struct_i&gt;
&lt;stringParm name="s2p1"&gt;Value 2&lt;/stringParm&gt;
&lt;/struct_i&gt;
&lt;/arrayOfStructParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
<p>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:</p>
<pre> &lt;?xml version="1.0" ?&gt;
&lt;xpcml version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='xpcml.xsd' &gt;
&lt;program name="prog1" path="/QSYS.lib/MYLIG.lib/PROG1.pgm"&gt;
&lt;parameterList&gt;
&lt;arrayOfIntParm name="intArray" count="3"&gt;
&lt;i&gt;12&lt;/i&gt;
&lt;i&gt;100&lt;/i&gt;
&lt;i&gt;4&lt;/i&gt;
&lt;/arrayOfIntParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
</div>
<div class="section"><h4 class="sectiontitle">Using the index attribute of the &lt;i&gt; and &lt;struct_i&gt;
tags to set array values</h4><p>You can use the index attribute of the &lt;i&gt;
and &lt;struct_i&gt; 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.</p>
<pre> &lt;?xml version="1.0" ?&gt;
&lt;xpcml version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='xpcml.xsd' &gt;
&lt;program name="prog1" path="/QSYS.lib/MYLIG.lib/PROG1.pgm"&gt;
&lt;parameterList&gt;
&lt;arrayOfIntParm name="intArray" count="3"&gt;
&lt;i index="2"&gt;12&lt;/i&gt;
&lt;i index="1"&gt;100&lt;/i&gt;
&lt;i index="0"&gt;4&lt;/i&gt;
&lt;/arrayOfIntParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
</div>
</div>
</body>
</html>