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

98 lines
5.7 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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="Converting existing PCML to XPCML" />
<meta name="abstract" content="The ProgramCallDocument class contains the transformPCMLToXPCML method that enables you to transform existing PCML documents to equivalent XPCML documents." />
<meta name="description" content="The ProgramCallDocument class contains the transformPCMLToXPCML method that enables you to transform existing PCML documents to equivalent XPCML documents." />
<meta name="DC.Relation" scheme="URI" content="rzahhxpcmlusing.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="rzahhxpcmlusingregconvert" />
<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>Converting existing PCML to XPCML</title>
</head>
<body id="rzahhxpcmlusingregconvert"><a name="rzahhxpcmlusingregconvert"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Converting existing PCML to XPCML</h1>
<div><p>The ProgramCallDocument class contains the transformPCMLToXPCML
method that enables you to transform existing PCML documents to equivalent
XPCML documents.</p>
<div class="section"><p>XPCML has comparable definitions for all of the elements and attributes
that you can define in PCML. Using transformPCMLToXPCML() converts the PCML
representation of the elements and attributes to the equivalent XPCML.</p>
<p>Note
that in some cases, equivalent XPCML attributes have a different name than
in PCML. For example, the attribute "usage" in PCML is the attribute "passDirection"
in XPCML. For more information about how to use XPCML compared to PCML, see <a href="rzahhxpcmlschema.htm#rzahhxpcmlschema">XPCML schema and syntax</a>.</p>
<p>The
method takes the existing PCML document, which you pass to it as an InputStream
object, and generates the equivalent XPCML as an OutputStream object. Because
transformPCMLToXPCML() is a static method, you can call it without first creating
a ProgramCallDocument object.</p>
</div>
<div class="section" id="rzahhxpcmlusingregconvert__exconvpcmltoxpcml"><a name="rzahhxpcmlusingregconvert__exconvpcmltoxpcml"><!-- --></a><h4 class="sectiontitle">Example: Converting a PCML document
to an XPCML document</h4><p>The following example shows how to convert
a PCML document (named myPCML.pcml) to an XPCML document (named myXPCML.xpcml).</p>
<div class="note"><span class="notetitle">Note:</span> You
must specify .xpcml as the file extension for XPCML files. Using .xpcml as
the file extension ensures that the ProgramCallDocument class recognizes the
file as XPCML. If you do not specify an extension, ProgramCallDocument assumes
that the file is PCML.</div>
<p><strong>PCML document myPCML.pcml</strong></p>
<pre> &lt;!-- myPCML.pcml --&gt;
&lt;pcml version="4.0"&gt;
&lt;program name="prog1" path="/QSYS.LIB/W95LIB.LIB/PROG1.PGM"&gt;
&lt;data type="char" name="parm1" usage="in" passby="reference"
minvrm="V5R2M0" ccsid="37" length="10" init="Value 1"/&gt;
&lt;/program&gt;
&lt;/pcml&gt;</pre>
<p><strong>Java™ code to convert myPCML.pcml to myPCML.xpcml</strong></p>
<pre> try {
InputStream pcmlStream = new FileInputStream("myPCML.pcml");
OutputStream xpcmlStream = new FileOutputStream("myXPCML.xpcml");
ProgramCallDocument.transformPCMLToXPCML(pcmlStream, xpcmlStream);
}
catch (Exception e) {
System.out.println("error: - "+e.getMessage());
e.printStackTrace();
}</pre>
<p><strong>Resulting XPCML document myXPCML.xpcml</strong></p>
<pre> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!-- myXPCML.xpcml --&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" passMode="reference"
minvrm="V5R2M0" ccsid="37" length="10"&gt;Value 1
&lt;/stringParm&gt;
&lt;/parameterList&gt;
&lt;/program&gt;
&lt;/xpcml&gt;</pre>
<p>For more information about transformPCMLToXPCML()
and the ProgramCallDocument class, see the following page:</p>
<blockquote>ProgramCallDocument
javadoc information</blockquote>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahhxpcmlusing.htm" title="Using XPCML is similar to using PCML. The following steps serve as a general outline for the actions that you need to perform to use XPCML.">Using XPCML</a></div>
</div>
</div>
</body>
</html>