Oxygen and Text Formatting

Sometimes xml files may have returns or tabs embedded within the text. Sometimes, this is appropriate for "listing" items in a free text field, however, in most cases this is accidental and undesired. It may cause funky html output, prevent find/replace functionality and instigate unnecessary headaches. The image to the right shows the 'purpose' element with many unwanted returns in the content.

Undesired returns in paragraph of text

These are some of the solutions I've come up with so far to deal with this - please add your own method if you find another way! Remove hard wrapping

Select Options > Preferences > Format and set up like the image on the right

1.Preferences > Format

uncheck 'Hard Line Wrap'

check 'Format and indent the document on open'

set 'Line width' to a large number (I like 500)

In same Dialogue box got to Format > XML and set up like image on right

2. Preferences > Format > XML

check 'Preserve text as is'

Selection Options > Preferences > Text

Check 'Line Wrap' box

In my experience, these preferences will NOT automatically fix the formatting. You may have to do one or all of the following:
Pretty Print

From Project panel, right click on project folder, select 'Open All Files'

Open All Files

Because you previously checked 'Format and indent the document on open' in Preference, this automatically "pretty prints" all of the XML files

This helps with find/replace functions

However, it does not get rid of carriage returns within an element

You must save each file (ctrl+w, ctrl+s, repeat)

Remove unwanted returns and tabs for entire document

ctrl+j each file

This joins all xml tags and text in the file( and makes it really really hard to read)