How to preserve newlines when formatting XML
Posted: Thu Jan 05, 2006 2:27 pm
Hi,
When I format my XML files, empty lines are removed. Is there a way to prevent this form happening. The empty lines are there for readability
Before:
After:
What I would like:
Is this possible?
Thanks in advance for any help!
Arjan Huijzer
When I format my XML files, empty lines are removed. Is there a way to prevent this form happening. The empty lines are there for readability

Before:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<test>
<node><a/></node>
<node><b/></node>
</test>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<test>
<node>
<a/>
</node>
<node>
<b/>
</node>
</test>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<test>
<node>
<a/>
</node>
<node>
<b/>
</node>
</test>
Thanks in advance for any help!
Arjan Huijzer