I have a program in Net Express which produces the following file:
<?xml version="1.0" encoding="UTF-8"?>
<suf:DebtEnquiryV1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:suf="http://www.kf.com/debtenquirylist" xmlns="http://www.kf.com/component" xsi:schemaLocation="http://www.kf.com/debtenquiry debtenquiry.xsd">
<suf:PartnerCode>SIB</suf:PartnerCode>
<suf:Reference>FILE NO. 1 ABC LTD.</suf:Reference>
<suf:EnquiryList>
<suf:Enquiry>
<suf:CustomerId>197810208772</suf:CustomerId>
<suf:Reference>0999999900000006999</suf:Reference>
</suf:Enquiry>
<suf:Enquiry>
<suf:CustomerId>198710208772</suf:CustomerId>
<suf:Reference>0999999900000006999</suf:Reference>
</suf:Enquiry>
</suf:EnquiryList>
</suf:DebtEnquiryV1>
However, when I run the program in Visual Cobol I get XML File Status -8 "This is an invalid position to insert the specified XML item". I have discovered that when removing "suf:" from IDENTIFIED BY the problem disappear. For example, this will work:
01 W543-DEBT-ENQUIRY-V1 IDENTIFIED BY "DebtEnquiryV1".
This will lead to -8 :
01 W543-DEBT-ENQUIRY-V1 IDENTIFIED BY "suf:DebtEnquiryV1".
Another strange thing is that I get different behaviours depending on where I keep the "suf:". For example, this will work:
02 W543-PARTNER-CODE PIC X(5) IDENTIFIED BY "PartnerCode".
This will work too in that the program doesn't result in -8, but the line will be omitted in the output file.
02 W543-PARTNER-CODE PIC X(5) IDENTIFIED BY "suf:PartnerCode".
I have attached the program. The project is an x86 INT/GNT project with no application.config and no special settings in Project Properties or elsewhere.
Note: I have tried the NAMESPACE IS clause but that won't produce the desired look of the output.
Note: It may be a better approach to use KEY IS ALL in some places, but unfortunately I get the same problem.