Question

6
Replies
164
Views
DivyaP56 Member since 2019 2 posts
Genesis10
Posted: 7 months ago
Last activity: 7 months 2 weeks ago
Solved

How to convert XML into formated pretty print XML

I have a requirement to convert a string XML into a formatted XML. The requirement also says that only request and response XML properties must be displayed and also it should not be on a pop up window, when i used OOTB functions like showxmlofpage i could see all pega properties included in it like pxObjClass. 

My approaches - tried to embed JavaScript and Java code 

Challenges - JS i included in a text file and refered it on a button but not working

Java code is throwing errors as it is lacking some classes. am not sure how to overcome this. Please share your inputs.

Sample Java code :

javax.xml.parsers.DocumentBuilderFactory dbf =newjavax.xml.parsers.DocumentBuilderFactory.newInstance();

Existing output :

<root><tag><nested>hello</nested></tag></root>

Expected output :

<root>   <tag>     <nested>hello</nested>   </tag> </root>

 

Pega Platform 7.1.9 Low-Code App Development Dev/Designer Studio Financial Services Senior System Architect
Share this page LinkedIn