Character limit when editing xml

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DBeeson
Posts: 4
Joined: Fri Jul 14, 2006 8:04 pm

Character limit when editing xml

Post by DBeeson »

Is there any way to set a limit of 80 characters on one line while editing, without using the format and indent feature? The files I'm editing also need to be viewed in VIM, which limits lines to 80 characters, but I'm finding it hard to estimate when to insert a newline in <oxygen /> without a guide.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

You can set the preferred number of characters per line in Options->Preferences -- Editor -- Format -- Line width - Format and Indent. Then you can use the format and indent action to format your document.
More, if you enable also the Hard line wrap option on the same preference page then oXygen will brak automatically a line if you enter more than line width characters om that line.

Best Regards,
George
DBeeson
Posts: 4
Joined: Fri Jul 14, 2006 8:04 pm

Post by DBeeson »

My problem with using the format and indent action is that it does not always indent tags in the same way I would if doing it myself. For example, when working with XHTML, I always have <p> elements indented like this:

Code: Select all


<p>
Multi line text goes here
and here
and here
</p>
Whereas the format and indent action formats it with the tags part of the paragraph, presumably because it contains no other elements.

Code: Select all


<p>Multi line text goes here
and here
and here</p>
I find the first way much easier to read, even though it might not be technically correct. Is there a way of telling <oxygen /> to format it in this way? I tried adding <p> to the list of preserve space elements, but that of course meant that it didn't wrap at 80 characters!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

<oXygen/> does not do that formatting because it is not technically correct. The result that you want for <p> and the initial <p> are not equivalent. If you normalize the result element you do not obtain the source element.

Regards,
Sorin
DBeeson
Posts: 4
Joined: Fri Jul 14, 2006 8:04 pm

Post by DBeeson »

Fair enough, now that I look at it more closely I can see you're right!
Post Reply