empty elements - add closing tag by default

Questions about XML that are not covered by the other forums should go here.
Posts: 17
Joined: Wed Oct 28, 2009 8:35 pm

empty elements - add closing tag by default

Post by anayram » Wed Feb 03, 2010 10:55 pm

Hi there,

In our project, we often need to add empty elements to the text (editing only attributes). As you know, empty elements may be written in a short form, omitting the end tag: <example/>; that is equivalent to the full form <example></example>.

In Oxygen, I've found that elements that do not require child elements appear in the short form by default (when adding a new element from Author mode). Is there a way to ask Oxygen to make it default to *always* add the complete form with both opening and closing tags?

We need this:

Code: Select all

We get this:

Code: Select all

<REGION REG="Arizona"/>

Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: empty elements - add closing tag by default

Post by adrian » Thu Feb 04, 2010 11:32 am


You can find the option you are looking for in Options -> Preferences -> Editor / Format / XML, Expand empty elements.

Please note that this option also applies to the Format and indent action in Text mode.

Let us know if you require further assistance.

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Post Reply