0

I have web service which returns xml as plain string. I need to format it like xml beautifier does. I expect it to be performed on client side by JavaScript. How can I do that? What libraries is better fitted for this task?

J.Olufsen
  • 13,415
  • 44
  • 120
  • 185

1 Answers1

0

One way of doing it is to use "JavaScript code prettifier" from Google.

You can find it here: http://google-code-prettify.googlecode.com/svn/trunk/README.html.

Follow the setup guide in the link and include the javascript file and then use it like so:

prettyPrintOne(XML_TO_BEAUTIFIED, 'xml')
Keith Enlow
  • 914
  • 6
  • 17