Undo Pretty Print : the return
Posted: Sat May 02, 2009 1:05 pm
Hi,
I'm using Oxygen XMl Editor for a couple of years now, for PHP website development.
I recently changed my way of parsing XML documents in PHP and I'm now facing the well-know issue of tabs and spaces inserted into "pretty print" saved document formats, like this :
<?xml version="1.0" encoding="UTF-8"?>
<document>
__<element>one</element>
__<element>two</element>
</document>
So I would like to be able to easily "turn off" pretty print to obtain a "one single line" or "two lines" version like this :
<?xml version="1.0" encoding="UTF-8"?>
<document><element>one</element><element>two</element></document>
Someone asked the question about "undo pretty print" a long time ago :
http://www.oxygenxml.com/forum/topic1341.html
One of your answers stressed the difficulty to undo pretty print :
This is also best to reduce the size of the file on the web server, both to speed up its loading and ease its parsing.
I suppose that this can be achieved by some editor configuration, or by taking some other action in the editor (for example by always editing the file in "Grid" editor mode and not using pretty print anymore), but this is not entirely clear to me even after reading the Oxygen help.
Could you give me an advice about how to achieve this ?
Cheers,
Gilles.
I'm using Oxygen XMl Editor for a couple of years now, for PHP website development.
I recently changed my way of parsing XML documents in PHP and I'm now facing the well-know issue of tabs and spaces inserted into "pretty print" saved document formats, like this :
<?xml version="1.0" encoding="UTF-8"?>
<document>
__<element>one</element>
__<element>two</element>
</document>
So I would like to be able to easily "turn off" pretty print to obtain a "one single line" or "two lines" version like this :
<?xml version="1.0" encoding="UTF-8"?>
<document><element>one</element><element>two</element></document>
Someone asked the question about "undo pretty print" a long time ago :
http://www.oxygenxml.com/forum/topic1341.html
One of your answers stressed the difficulty to undo pretty print :
I think that my case is more basic : I don't want to really "undo" what was done with pretty print, but rather produce a one single line (or two) saved version of the file, without any extra character than the pure XML content.george wrote: If you look at the format and indent action as a function then that is not a bijective function, it will map any document X to a document Y but you cannot determine X if you know Y because there is a class of document {X1, X2, .... } that all will be mapped to Y so if you know Y you cannot determine which of these X1, X2, etc. was the initial document the format and indent was applied to.
This is also best to reduce the size of the file on the web server, both to speed up its loading and ease its parsing.
I suppose that this can be achieved by some editor configuration, or by taking some other action in the editor (for example by always editing the file in "Grid" editor mode and not using pretty print anymore), but this is not entirely clear to me even after reading the Oxygen help.
Could you give me an advice about how to achieve this ?
Cheers,
Gilles.