You are here: PSPad forum > English discussion forum > Re: Formatting XML code

Re: Formatting XML code

#1 Formatting XML code

Posted by: aderda | Date: 04/16/2012 09:05 | IP: IP Logged

Hi,

I use "Reformat HTML code" feature in order to format XML code. It works perfectly fine, as long as the XML file is without comments. Adding a comment breaks the indentation. The problem does not occur, if you add a comment to an HTML file. Now the question is, if it's a bug. I'm not sure if formatting is supposed to work only for HTML, but I think it should work for XML as well.

Best regards,
Adam

Edited 1 time(s). Last edit at 04/16/2012 09:05 by aderda.

Options: Reply | Quote | Up ^


#2 Re: Formatting XML code

Posted by: pspad | Date: 04/16/2012 09:14 | IP: IP Logged

Does your file is higlighted with XML higlighter?
Do you use the current PSPad version?

Options: Reply | Quote | Up ^


#3 Re: Formatting XML code

Posted by: aderda | Date: 04/17/2012 15:56 | IP: IP Logged

Hi,

Yes, I use the latest stable version (4.5.6) and yes, I use XML highlighter. To see an example, please try to format the following piece of XML:


<?xml version="1.0" encoding="windows-1250"?>
<a>
<b>
<!-- comment -->
</b>
</a>

Edited 1 time(s). Last edit at 04/17/2012 15:57 by aderda.

Options: Reply | Quote | Up ^


#4 Re: Formatting XML code

Posted by: ino | Date: 04/18/2012 15:01 | IP: IP Logged

Hi,
I just can confirm wrong formating in latest version PSPad 4.5.7(2445)

This piece of code:
<?xml version="1.0" encoding="windows-1250"?>
<a>
<b>
<!-- comment -->
</b>
</a>

was formatted to this one:
<?xml version="1.0" encoding="windows-1250"?>
<a>
..<b>
....<!-- comment --></b>
..</a>

(I used dots instead of spaces)

Options: Reply | Quote | Up ^


#5 Re: Formatting XML code

Posted by: pspad | Date: 04/26/2012 10:56 | IP: IP Logged

Fix will be available in the next build

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2014 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák