2016-09-20 37 views
0

我有一个xml内容(来自服务)的有效载荷,我有一个展开/折叠面板上的女巫我点击并通过绑定在标签显示的内容该有效载荷。漂亮的打印面板中的服务XML内容SAPIU5/Javascript

问题是,它不是以漂亮的标准xml格式显示东西,而是将所有东西都随机放在一个接一个的东西上。

如何漂亮打印的内容是这样的事情后,我展开面板:

<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> 

回答

0

从我的角度来看,这是Label控件的滥用。尝试m.FormattedTextm.Text

+0

我想我必须使用vkbeautify库,但我不知道使用它很热。我正在尝试做一些事情。 – CIC92