Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nice bit of code to format an xml string

Anyone got a ready made function that will take an XML string and return a correctly indented string?

eg

<XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML>

and will return nicely formatted String in return after inserting linebreaks and tabs or spaces?

like image 592
Toby Allen Avatar asked Oct 24 '08 15:10

Toby Allen


1 Answers

The RTL has FormatXMLData in XMLDoc.pas that accepts and returns strings.

like image 135
Bruce McGee Avatar answered Oct 08 '22 04:10

Bruce McGee