Generate Formatted XML


PeopleCode includes a class library for working with XML documents called XMLDoc.

There are a number of very useful methods within in this class including, GenFormattedXmlString which takes XML (as a string) and formats it with new line characters and indents so its more readable.

To use this method, simply declare an XmlDoc object, pass it the unformatted XML and call the GenFormattedXmlString method like so:

Local XmlDoc &oXD;
Local string &sUnformattedXML, &sFormattedXML;

&sUnformattedXML = "[Your unformatted XML goes here]";
&oXD = CreateXmlDoc(&sUnformattedXML);
&sFormattedXML = &oXD.GenFormattedXmlString();

Revision #1
Created Tue, Jul 23, 2019 7:42 PM by PeopleSoft Wiki
Updated Tue, Jul 23, 2019 7:57 PM by PeopleSoft Wiki