The feature "HTML"->"Reformat HTML Code"
has a bug where it removes leading and trailing spaces from values in the
xml source. The reformat should not change the values in the tags, it should
just reformat the xml structure.
To reproduce
1. save the following as "Test.xml"
<?xml version="1.0" encoding="UTF-8"?>
<TestStructure>
<leadingSpace> leading_space</leadingSpace>
<twoLeadingSpace> leading_space</twoLeadingSpace>
<trailingSpace>trailing_space </leadingSpace>
</TestStructure>
NOTE:
1. the first tag <leadingSpace> has a value with a leading space
2. the second tag <twoLeadingSpace> has a value with 2 leading spaces
3. the third tag <trailingSpace> has a value with a trailing space
2. open the file in PsPad and use
"View" -> "Change Syntax" -> "XML"
3. select "HTML" -> "Compress HTML Code"
* this works, the spaces are preserved:
<?xml version="1.0" encoding="UTF-8"?><TestStructure><leadingSpace>
leading_space</leadingSpace><twoLeadingSpace>
leading_space</twoLeadingSpace><trailingSpace>trailing_space
</leadingSpace></TestStructure>
4. select "HTML" -> "Reformat HTML Code"
* This is the problem,
The reformat changes the values in the tags by removing spaces:
<?xml version="1.0" encoding="UTF-8"?>
<TestStructure>
<leadingSpace>leading_space</leadingSpace>
<twoLeadingSpace>leading_space</twoLeadingSpace>
<trailingSpace>trailing_space</leadingSpace>
</TestStructure>
--
<http://forum.pspad.com/read.php?4,64997,64997>
PSPad freeware editor http://www.pspad.com