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

128 lines
7.3 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="Comparison of XPCML source to PCML source" />
<meta name="abstract" content="XPCML differs from PCML in several ways, but one major difference is that XPCML allows you to specify the values of input parameters within the XPCML source file." />
<meta name="description" content="XPCML differs from PCML in several ways, but one major difference is that XPCML allows you to specify the values of input parameters within the XPCML source file." />
<meta name="DC.Relation" scheme="URI" content="rzahhxpcmlschema.htm" />
<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="rzahhxpcmlschemacompare" />
<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>Comparison of XPCML source to PCML source</title>
</head>
<body id="rzahhxpcmlschemacompare"><a name="rzahhxpcmlschemacompare"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Comparison of XPCML source to PCML source</h1>
<div><p>XPCML differs from PCML in several ways, but one major difference
is that XPCML allows you to specify the values of input parameters within
the XPCML source file.</p>
<div class="section"><p>PCML allows you to use the init attribute of the &lt;data&gt; tag
to specify the initial value for a data element in the PCML source. However,
using PCML to specify values has the following limitations:</p>
<ul><li>You cannot use the init attribute to set array values</li>
<li>Validation of the init value occurs only after parsing the PCML document</li>
</ul>
<p>To specify array values in PCML, you must first read in and parse
the PCML document, then perform a series of calls to ProgramCallDocument.setValue().</p>
<p>Using
XPCML makes it easier to specify values of single elements and arrays:</p>
<ul><li>Specify values for both scalar and array elements in the XPCML source
file</li>
<li>Validate the specified array values at parse time</li>
</ul>
<p>The following simple comparisons indicate ways in which XPCML differs
from PCML. Each example defines a program call for an iSeries™ server program.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example: Calling an iSeries server program</h4><p>The
following examples call an iSeries server program called prog1.</p>
<p><strong>XPCML
source code</strong></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;program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;parameterList&gt;
&lt;stringParm name="parm1" passDirection="in" length="10"&gt;Parm1&lt;/stringParm&gt;
&lt;intParm name="parm2" passDirection="in"&gt;5&lt;/intParm&gt;
&lt;shortParm name="parm3" passDirection="in"&gt;3&lt;/shortParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
<p><strong>PCML source code</strong></p>
<pre> &lt;pcml version="4.0"&gt;
&lt;program name="prog1" path="QSYS.LIB/MYLIB.LIB/PROG1.PGM"&gt;
&lt;data name="parm1" type="char" usage="input" length="10" init="Parm1"/&gt;
&lt;data name="parm2" type="int" usage="input" length="4" init="5"/&gt;
&lt;data name="parm3" type="int" usage="input" length="2" precision="16" init="3"/&gt;
&lt;/program&gt;
&lt;/pcml&gt;</pre>
</div>
<div class="section" id="rzahhxpcmlschemacompare__callprogramarray"><a name="rzahhxpcmlschemacompare__callprogramarray"><!-- --></a><h4 class="sectiontitle">Example: Calling an iSeries server
program using an array of string parameters</h4><p>The following examples
call an iSeries server
program called prog2 and define parm1 as an array of string parameters. Note
the functionality of XPCML:</p>
<ul><li>Initializes the value of each element in the array</li>
<li>Specifies the input values as element content that a fully validating
XML parser can verify</li>
</ul>
<p>You can take advantage of this XPCML functionality without writing
any Java™ code.</p>
<p>PCML
cannot match the XPCML performance. PCML cannot initialize the value of each
element in the array. PCML cannot validate the init values at parse time.
To match the functionality of XPCML, you would have to read in and parse the
PCML document, then code your Java application to set the value for each
array element. You would also have to write code to validate the parameters.</p>
<p><strong>XPCML
source code</strong></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;program name="prog2" path="/QSYS.LIB/W95LIB.LIB/PROG2.PGM"&gt;
&lt;parameterList&gt;
&lt;arrayOfStringParm name="parm1" passDirection="in"
length="10" count="3"&gt;
&lt;i&gt;Parm1-First value&lt;/i&gt;
&lt;i&gt;Parm1-Second value&lt;/i&gt;
&lt;i&gt;Parm1-Third value&lt;/i&gt;
&lt;/arrayOfStringParm&gt;
&lt;longParm name="parm2" passDirection="in"&gt;5&lt;/longParm&gt;
&lt;zonedDecimalParm name="parm3" passDirection="in"
totalDigits="5" fractionDigits="2"&gt;32.56&lt;/zonedDecimalParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
<p><strong>PCML source code</strong></p>
<pre> &lt;pcml version="4.0"&gt;
&lt;program name="prog2" path="QSYS.LIB/MYLIB.LIB/PROG2.PGM"&gt;
&lt;data name="parm1" type="char" usage="input" length="20" count="3"/&gt;
&lt;data name="parm2" type="int" usage="input" length="8" init="5"/&gt;
&lt;data name="parm3" type="zoned" usage="input" length="5" precision="2" init="32.56"/&gt;
&lt;/program&gt;
&lt;/pcml&gt;</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahhxpcmlschema.htm" title="XPCML documents, called XPCML source files, contain tags and data that fully define calls to programs on your iSeries server.">XPCML schema and syntax</a></div>
</div>
</div>
</body>
</html>