views:

54

answers:

2

Hi Friends,

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</value>
</section>

But after saving its looks like

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

Thanks,
Praveen J

A: 

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.

symcbean
A: 

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.

Angelo R.