Generating COBOL Structures with XML



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Generating COBOL Structures with XML

Postby Passager » Wed May 06, 2015 3:04 am

Hello everybody,

How to generate an XML document with multiple namespaces prefixes ?, for example :

01 NIV-A
05 NIV-B PIC X(8) VALUE 'Valeur B'.
05 NIV-C PIC X(8) VALUE 'Valeur B'.
05 NIV-D PIC X(8) VALUE 'Valeur B'.

<prefix1:NIV-A>
<prefix1:NIV-B>Valeur B</prefix1:NIV-B>
<prefix1:NIV-C>Valeur C</prefix1:NIV-C>
<prefix2:NIV-D>Valeur D</prefix2:NIV-D>
</prefix1:NIV-A>

Thanks a lot for your help.
Passager
 
Posts: 1
Joined: Wed May 06, 2015 2:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: Generating COBOL Structures with XML

Postby jself » Tue Jul 07, 2015 12:12 am

I'm looking for the same answer. Have you had any luck in figuring it out yet?
jself
 
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Generating COBOL Structures with XML

Postby jself » Fri Jul 24, 2015 8:23 pm

If your trying to use the cobol xml generate statement and you want to use namespaces looks like you have to do the following.
Manualy code for the prefix. For ex: in your xml copy book in cobol use XXXNIV-A, XXXNIV-B, XXXNIV-C for prefix1 and YYYNIV-D for prefix2.
Once your xml is generated then use an inspect replacing statement to change XXXNIV to prefix1:NIV and YYYNIV to prefix2:NIV.
jself
 
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Generating COBOL Structures with XML

Postby madooeiei » Mon Feb 15, 2016 2:36 pm

Thanks for the info.
madooeiei
 
Posts: 4
Joined: Mon Oct 12, 2015 2:53 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post