Question

3
Replies
70
Views
Kumar Pushkar (kumap20)
PEGA
Principal Solutions Engineer
Pegasystems Inc.
IN
kumap20 Member since 2020 1 post
PEGA
Posted: April 22, 2021
Last activity: 3 weeks ago
Posted: 22 Apr 2021 3:08 EDT
Last activity: 1 Jun 2021 3:55 EDT

How to remove empty tags in streamed XML?

Hi All,

In my stream XML rules, all the elements are marked as optional.

But, due to business UI requirement, we had to initialize all the page properties before loading the UI.

Due to this, although the empty scalar properties are not generated in output xml string ( via Property-Set-XML) , the complex elements (page/page lists) are still present ,since they are present on clipboard.

Is there any way to remove these XML tags after generation? OOT/Java probably?

In below example, highlighted tags shall be removed:

<ns1:GrpHdr> <ns1:CreDtTm>2021-03-05T03:30:00.000Z</ns1:CreDtTm> <ns1:MsgRcpt> <ns1:Nm>ABC Bank</ns1:Nm> <ns1:PstlAdr> <ns1:AdrTp> <ns1:Prtry> </ns1:Prtry> </ns1:AdrTp> <ns1:AdrLine>New Jersey</ns1:AdrLine> </ns1:PstlAdr> </ns1:MsgRcpt> </ns1:GrpHdr>

***Edited by Moderator: Pooja Gadige to add platform capability tag***
Pega Platform 8.4.4 Enterprise Application Development Dev/Designer Studio Data Integration Lead System Architect