Feature request: Preserve empty lines in "format and in

Are you missing a feature? Request its implementation here.
Henry

Feature request: Preserve empty lines in "format and in

Post 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.
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Also, by-file option to preseve or strip space

Post 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.
franqueli
Posts: 5
Joined: Thu Mar 10, 2005 8:33 pm

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

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
franqueli
Posts: 5
Joined: Thu Mar 10, 2005 8:33 pm

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

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
franqueli
Posts: 5
Joined: Thu Mar 10, 2005 8:33 pm

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

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Post Reply