COBOL XML Parser XSI:NIL Attribute issue

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

COBOL XML Parser XSI:NIL Attribute issue

Postby Yong » Fri Dec 24, 2010 7:41 am

As we know, COBOL can parse xml by using EVENTs, each tag name, attribute name, tag value will trigger different events. but recently, i met some issue regarding the XSI:NIL xml attribute. in below xml, there is one attribute XSI:NIL='true' which means there will no transactionamount value for this tag, in my program, it is setting a indicator to be 'N' so that cobol xml parser will not get the transactionamount value from the next CONTENT-CHARACTERS event.
<transactionAmount xsi:nil="true" xmlns:xsi=""/>.
for doing this, firstly, we need to identify this attributs by using EVENT-NAME='ATTRIBUTE-NAME' and XML-TEXT = 'xsi:nil', it is working fine in production environment, but it is failing in test environment because XSI:NIL will trigger two event. XSL: will trigger NAMESPACE-DECLARATION event and 'NIL' will trigger ATTRIBUTE-NAME event and XML-TEXT will be 'nil' instead of 'xsi:nil'.

Since the production code is same with the code in testing environment. Can somebody let me know what caused this issue? is it because of different verson of COBOL XML parser? normally, how many events will XSI:NIL Attribute trigger?

Posts: 2
Joined: Mon Sep 27, 2010 8:44 am
Has thanked: 0 time
Been thanked: 0 time

Re: COBOL XML Parser XSI:NIL Attribute issue


Return to IBM Cobol


  • Related topics
    Last post