<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE-CH" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Background information (skip if not interesting)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I try to solve with XML::Compile therefore sorry if you have to read a few lines more.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">SIC (Swiss Interbank Clearing) is migrating this year from proprietary formats to an ISO20022 XML messages like already used in SEPA where they are called pacs messages.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The target of the received payment messages is a z/OS Mainframe application written in COBOL and the content of the message is in a Copybook (fixed length structure analogous to a C struct).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We use IBM Integration Bus (IIB) which parses/serializes XML messages validating against the SIC schemas. IIB has the capability to import Copybooks allowing to serialize/parse these fixed length messages.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The transformation (mapping of the fields) is also done in IIB.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am looking for a way to create programmatically the Copybook and the mapping statements out of the schema information.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Initially I planned to use XML::LibXML to parse the schema but as I need the logical tree represented by the schema and not just the parsed XML schema tree&nbsp; I thought there must be a better way and &#8230; I found XML::Compile.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Question<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">XML::Compile is already doing the hard job namely parsing the schema and building a hash with the type information out of it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In order to build the Copybook I need access to the element and its type information.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to get the below template information into a hash so that I can easily access it in my script?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Or does the walkTree method allow me to get the element name with its type information out of the code reference?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">A code snippet or a kind of tutorial is what would help a lot.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Many thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Markus<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># is a x0:Document_CH_pacs008<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">{ # sequence of FIToFICstmrCdtTrf<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; # is a x0:FIToFICustomerCreditTransferV02_CH_pacs008<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; FIToFICstmrCdtTrf =&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; { # sequence of GrpHdr, CdtTrfTxInf<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp; # is a x0:GroupHeader33_CH_pacs008<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp; GrpHdr =&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp; { # sequence of MsgId, CreDtTm, BtchBookg, NbOfTxs, CtrlSum,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; TtlIntrBkSttlmAmt, IntrBkSttlmDt, SttlmInf, PmtTpInf,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; InstgAgt, InstdAgt<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # is a xs:string<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # length &lt;= 35<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # length &gt;= 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgId =&gt; &quot;example&quot;,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="mso-fareast-language:DE-CH">_____________________________________________________________<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="mso-fareast-language:DE-CH">Dr.<i>
</i></span><span style="mso-fareast-language:DE-CH">Markus Sonderegger<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="mso-fareast-language:DE-CH">Application Integration<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="mso-fareast-language:DE-CH">Bank Julius Baer &amp; Co. Ltd.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="mso-fareast-language:DE-CH">Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="mso-fareast-language:DE-CH">Telephone &#43;41 58 88 77281, Telefax &#43;41 58 88 74851<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="mso-fareast-language:DE-CH">Mobile Phone &#43;41 79 698 09 79<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE-CH"><a href="http://www.juliusbaer.com"><span lang="EN-US">www.juliusbaer.com</span></a></span><span lang="EN-US" style="mso-fareast-language:DE-CH"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE-CH"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="mso-fareast-language:DE-CH">Julius Baer cares about the environment: Please do not print this e-mail unless you really need to.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
</div>
<br>
<br>
<div style="font-family:Arial, Sans-Serif; font-size:8pt; color:#000000;">*****JuliusBaer Disclaimer***** This e-mail is for the intended recipient only and may contain confidential or privileged information. If you have received this e-mail by mistake, please
 contact us immediately and completely delete it (and any attachments) and do not forward it or inform any other person of its contents. If you send us messages by e-mail, we take this as your authorisation to correspond with you by e-mail, however, we reserve
 the right not to execute orders and instructions transmitted by e-mail at any time and without further explanation. If you do not wish to receive any further e-mail correspondence please let us know. E-mail transmission cannot be guaranteed to be secure or
 error-free as information could be intercepted, amended, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Neither the Julius Baer Group nor the sender accept liability for any errors or omissions in the content of this message which
 arise as a result of its e-mail transmission. Please note that all e-mail communications to and from the Julius Baer Group may be monitored. This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase
 or sale of any financial instrument or as an official confirmation of any transaction.</div>
</body>
</html>