Skip to main content

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.

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.

I just found out that by omitting the namespace prefix in the root element it works. Is this a restriction in Cobol? In that case the following is all right:

<rootElement> ... </rootElement>

But not this:

<abc:rootElement> ... </abc:rootElement>


I just found out that by omitting the namespace prefix in the root element it works. Is this a restriction in Cobol? In that case the following is all right:

<rootElement> ... </rootElement>

But not this:

<abc:rootElement> ... </abc:rootElement>

This seems like it might be a bug to me, especially since it works correctly in Net Express. I see no reason why you shouldn't be able to have the namespace prefix on the root element.

Please open up a support incident with Micro Focus Technical Support and we will report the problem.

Thanks.