Page 1 of 1

Feature request: Preserve empty lines in "format and in

Posted: Mon May 03, 2004 6:27 pm
by Henry
I often insert empty lines into XML text to improve readability.

oXygen's format and indent routine always removes empty lines.
This creates one long listing which is very hard to read.

It would be helpful if oXygen could be set to preserve empty lines
when formatting. A checkbox named "Preserve empty lines" in the
pretty print options would be a nice new feature.

Also, by-file option to preseve or strip space

Posted: Thu May 13, 2004 7:23 pm
by dsewell
Currently, you can set "Preserve space elements" and "Strip space elements" as a global option.

This is fine if one is always working with the same schema or DTD. But a <p> element in one schema may not have the same content model as in another schema. So it would be nice to be able to associate these choices with individual files. Probably the best strategy would be to allow the creation of rule groups that could be saved by name and then associated with a file. So I might have a rule group named "TEI" that would specify to preserve space elements for <p>, <lg>, etc., and then I could choose that rule group when editing the file.

Re: Feature request: Preserve empty lines in "format an

Posted: Tue Jan 31, 2006 9:59 pm
by franqueli
I second this. Removing the empty lines on format and indent is really annoying.


Henry wrote:I often insert empty lines into XML text to improve readability.

oXygen's format and indent routine always removes empty lines.
This creates one long listing which is very hard to read.

It would be helpful if oXygen could be set to preserve empty lines
when formatting. A checkbox named "Preserve empty lines" in the
pretty print options would be a nice new feature.

Re: Feature request: Preserve empty lines in "format an

Posted: Wed Feb 01, 2006 1:23 pm
by sorin_ristache
Hello,
Henry wrote:It would be helpful if oXygen could be set to preserve empty lines
when formatting. A checkbox named "Preserve empty lines" in the
pretty print options would be a nice new feature.
franqueli wrote:I second this. Removing the empty lines on format and indent is really annoying.
<oXygen/> implements the standard collapse method of whitespace normalization. You suggest a mix of the collapse and preserve methods. Other users may be confused by the mix. The Preserve space elements list in Options -> Preferences -> Editor / Format was introduced for this purpose: exceptions of whitespace normalization for some XML elements.

Regards,
Sorin

Re: Also, by-file option to preseve or strip space

Posted: Wed Feb 01, 2006 4:19 pm
by sorin_ristache
Hello David,
dsewell wrote:Currently, you can set "Preserve space elements" and "Strip space elements" as a global option.

This is fine if one is always working with the same schema or DTD. But a <p> element in one schema may not have the same content model as in another schema. So it would be nice to be able to associate these choices with individual files. Probably the best strategy would be to allow the creation of rule groups that could be saved by name and then associated with a file.
Different schemas usually have different target namespaces, to which different prefixes are associated in the documents. Adding the prefixed element name to the Preserve space elements list will ensure that the whitespace is preserved in only one document type. For example if you want to apply formatting to p elements in a TEI P5 document that begins with

Code: Select all

<tei:TEI xmlns:tei="http://www.tei-c.org/ns/1.0">
but not to p elements in a DocBook document you just add tei:p to the Preserve space elements list.

Also we could invent a processing instruction which disables formatting for some tags. The drawback is that it would work only in <oXygen/> but I think it would be easier to use than complicated groups of pretty-print rules.

Regards,
Sorin

Re: Feature request: Preserve empty lines in "format an

Posted: Fri Feb 10, 2006 8:18 pm
by franqueli
I think you need to give your user's a bit more credit. Any confusion about "Preserve all empty lines" vs "Preserve space for these elements" can be cleared up with a nice help entry and some UI hints.

For example let's say we add a "Preserve all empty lines" checkbox right above "Preserve space elements" and "Strip space elements" list boxes in in Options -> Preferences -> Editor / Format. If you check the "Preserve all empty lines" box the list boxes below are grayed out. This would let user's know 'Hey you can't have it both ways'.

As a user of your product, which is excellent by the way, I'm telling you that this feature is something I would love to have.

Franqueli
sorin wrote:Hello,

<oXygen/> implements the standard collapse method of whitespace normalization. You suggest a mix of the collapse and preserve methods. Other users may be confused by the mix. The Preserve space elements list in Options -> Preferences -> Editor / Format was introduced for this purpose: exceptions of whitespace normalization for some XML elements.

Regards,
Sorin

Re: Feature request: Preserve empty lines in "format an

Posted: Mon Feb 13, 2006 7:08 pm
by sorin_ristache
Hello,
franqueli wrote:For example let's say we add a "Preserve all empty lines" checkbox right above "Preserve space elements" and "Strip space elements" list boxes in in Options -> Preferences -> Editor / Format. If you check the "Preserve all empty lines" box the list boxes below are grayed out. This would let user's know 'Hey you can't have it both ways'.

As a user of your product, which is excellent by the way, I'm telling you that this feature is something I would love to have.
A new option for preserving empty lines will be added in Options -> Preferences -> Editor / Format.

Regards,
Sorin

Re: Feature request: Preserve empty lines in "format an

Posted: Fri Feb 17, 2006 6:23 pm
by franqueli
Hey Sorin,
Glad to here this option will be added.

I just wanted to clarify one thing. I took a look at how "Preserve Space Element" works and think that option should be available even if the user chooses to "Preserve empty lines".
They are two fairly different things.

Franqueli
sorin wrote:Hello,

A new option for preserving empty lines will be added in Options -> Preferences -> Editor / Format.

Regards,
Sorin

Posted: Fri Feb 17, 2006 7:42 pm
by sorin_ristache
Hello,

That is how we implemented the "Preserve empty lines" setting: as an independent checkbox which does not affect the preserve space elements list. It will be available in the version 7.1.

Regards,
Sorin