Page 1 of 1

Character limit when editing xml

Posted: Fri Jul 14, 2006 8:07 pm
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.

Posted: Fri Jul 14, 2006 8:56 pm
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

Posted: Sat Jul 15, 2006 12:06 am
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!

Posted: Tue Jul 18, 2006 9:26 am
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

Posted: Wed Jul 19, 2006 1:33 am
by DBeeson
Fair enough, now that I look at it more closely I can see you're right!