Question
Citi
US
Last activity: 8 Feb 2020 0:41 EST
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>