empty elements - add closing tag by default

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

empty elements - add closing tag by default

Post by anayram »

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

<REGION REG="Arizona"></REGION>
We get this:

Code: Select all

<REGION REG="Arizona"/>
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: empty elements - add closing tag by default

Post by adrian »

Hi,

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.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply