0

I have a Payload with xml content(from a service) and I have a expand/collapse panel on witch I click and display by binding in a label the content of that payload.

The problem is that is not displaying the stuff in a prettyprint standard xml format but it puts everything random like one stuff after another.

How do I pretty print the content to be something like this after I expand the panel:

<bookstore>
  <book category="children">
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="web">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore>

and not something like this:

<bookstore>
  <book category="children"><title>Harry Potter</title><author>J K.Rowling</author><year>2005</year>    .....</bookstore>
CIC92
  • 15
  • 9
  • Does this answer your question? [Pretty printing XML with javascript](https://stackoverflow.com/questions/376373/pretty-printing-xml-with-javascript) – Martin Jul 27 '21 at 10:48

1 Answers1

0

From my perspective this is a misuse of Label control. Try m.FormattedText or m.Text

Shidai
  • 229
  • 1
  • 8
  • I think I have to use vkbeautify library but I don't know very well hot to use it. I'm trying to do something right now. – CIC92 Sep 21 '16 at 10:23