开发者

How to save a the content into the file with neat alignment?

I am having a textbox, in that i have loaded a xml file. After editing and saving the xml content into the xml file, the content is not in the right formate. While loading again, its not in the xml format

How to save a the content into the file with neat alignment?

Please help me

For Example

I need to save like the following

<section>
<value>a</value>
<value>b&开发者_如何学运维lt;/value>
</section>

But after saving its looks like

<section><value>a</value><value>b</value></section>

Thanks,

Praveen J


As Gordon says your question makes no sense - the XML fragment is still "well-formed" (but its far from complete) so it is in the right format.

Do you mean you want to preserve the format it was submitted in? In which case output it using <pre>...</pre> tags. OTOH there are standard tools out there which wil format XML according to specific standards - e.g. geshi

C.


I think is issue is that it doesn't preserve whitespace, so opening the xml file later shows it all in a single line as opposed to spaced/tabbed as originally created.

You can try white-space: physical as a CSS attribute on your textarea. Alternatively you can try adding the attribute/value pair "wrap=hard" to your textarea declaration. Both methods should preserve whtepace.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜