1

I am using TEMP-TABLE files with DATA-RELATIONs and WRITE-XML function to create XML files. However, the NAMESPACE-URI value is printing in both the document header and the first data tag:

xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrCdtTrfInitn xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">

This is what I want:

xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

<CstmrCdtTrfInitn>  

This is the code that is populating the NAMESPACE-URI

 DEFINE DATASET Document NAMESPACE-URI "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" FOR CstmrCdtTrfInitn, GrpHdr, InitgPty, Id, OrgId, Othr, Purp, PmtInf, PmtTpInf, SvcLvl,
                           ReqdExctnDt, LclInstrm, Dbtr, DbtrAcct, Id-DbtrAct, Othr-DbtrAct, DbtrAgt, FinInstnId, ClrSysMmbId, ClrSysId, PstlAdr-DbtrAgt, CdtTrfTxInf, PmtId, 
                           Amt, InstdAmt, CdtrAgt, FinInstnId-CR, ClrSysMmbId-CR, Cdtr, CdtrAcct, Id-CR,  PstlAdr,  PstlAdr-CR, PstlAdr-Cdtr, Othr-CI, Othr-CAgt, Id-Dbtr, 
                           OrgId-Dbtr, Othr-Dbtr, SchmeNm
    DATA-RELATION XML-1 FOR CstmrCdtTrfInitn, GrpHdr
                             RELATION-FIELDS(MsgId, MsgId)
                             NESTED  

How can I get rid of the duplicate NAMESPACE-URI attribute?

1 Answer 1

0

From an XML point of view the additional namespace declaration is irrelevant. It does however look odd. I could not find any way to suppress it and recommend opening a support case with Progress.

The following snippet demonstrates the issue:

define temp-table tt1 serialize-name 'Header'
    field id as int initial 1
    .

define temp-table tt2 serialize-name 'Data' 
    field id as int initial 1
    .

define dataset Document namespace-uri 'double'
    for tt1, tt2
    data-relation dr
        for tt1, tt2
        relation-fields( id, id )
        foreign-key-hidden
        nested
        .

create tt1.
create tt2.

def var lcc as longchar no-undo.
dataset Document:write-xml( 'longchar', lcc, true ).
message string( lcc ).

Watch it run on ABLDojo.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, Steven. I'll do that. My customer's bank is very picky about the format of the payment XML file!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.