114 lines
5.4 KiB
HTML
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> <?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></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> <?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></pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Using the index attribute of the <i> and <struct_i>
|
||
|
tags to set array values</h4><p>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.</p>
|
||
|
<pre> <?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></pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|