Author Topic: XML Beautify only on view possible (like softwrap)?  (Read 2225 times)

blueboy

  • Community Member
  • Posts: 16
  • Hero Points: 1
XML Beautify only on view possible (like softwrap)?
« on: November 06, 2009, 10:10:02 am »
Hi,


I have following problem/request with unformated XML document. If I open an unformated (no idents, no spaces, no tabs, no CR) I'd like to see it in a beautified view but without changes to the document, e.g. if the document is opened and I enable softwrap the view to the document has changed, but not the document!

If I execute the beautifier the view has changed and I can see the document in my requested way, but the content of the document has changed (title with post *) too.
Is there a way only to change the view in the editor, but not the document (may be a small change in a macro file)?



BR
Robert

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Re: XML Beautify only on view possible (like softwrap)?
« Reply #1 on: November 06, 2009, 01:53:33 pm »
I'm not sure I understand.  If I open an XML file and beautify it, the editor contents are changed (we'll call this the view), but the actual file itself is not changed (we'll call that the document).  Are we using the same terminology?

If you execute the beautifier, what would you like to see?  Do you want the changed status (the *) to not be set for the editor window?

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: XML Beautify only on view possible (like softwrap)?
« Reply #2 on: November 06, 2009, 10:29:46 pm »
It sounds like you want to edit the file in beautify view but have it saved on disk with no whitespace.  The only way to do that is to remove all whitespace when the file is closed or slick closes and to beautify it automatically when the file is opened.  You can write macros to achieve that but you can't remove absolutely all whitespace because you'll get words running together.  If you're trying to save space on disk or keep the file size small for whatever reason, maybe compression would be better.

Graeme