Page 1 of 1

Conversion to entity in Author view

Posted: Sun Nov 10, 2013 4:32 pm
by Kentt
Hello,

If I type in the "less than" and "greater than" characters in the Author view, only the "less than" character is converted automatically to an entity. Is there a way to change this behavior and make both characters get converted automatically? Thanks.

Re: Conversion to entity in Author view

Posted: Mon Nov 11, 2013 12:55 pm
by Radu
Hi,

Could you elaborate on your use case?

The ">" character is not an illegal character in XML content (only the "<" is). So as it is not necessary to convert it to the character entity equivalent, Oxygen does not do this.

If you want instead of ">" you could insert directly the entity equivalent from the Oxygen "Entities" view but this needs to be done manually. Or you could use our Java-based API to intercept the ">" key typed and insert the entity reference > instead of the character.

Regards,
Radu

Re: Conversion to entity in Author view

Posted: Tue Aug 12, 2014 10:23 am
by Eddie
Hello,

Slightly different to the original post.

This isn't really important but I also noticed that the less than sign is shown as just "<" in Author view, but the greater than sign is shown as ">" in dummy "gt" tags.
Is it to save space in Author view (by not enclosing "<" in dummy tags)?
I usually work in Text view so it's not really a problem, but it seems quite incongruous when you switch to Author view.

Re: Conversion to entity in Author view

Posted: Tue Aug 12, 2014 10:49 am
by Radu
Hi Eddie,

In the saved XML content the < character always needs to be escaped to <, otherwise it breaks the XML validation. So in the Author page we just present it as a simple < character in the text content and let the user insert it as a simple character for convenience. When the XML is saved the Author page converts < to < automatically.

The > character in text content actually does not break the XML validation. So for example if you are editing in the Text mode it is not necessary for you to convert it to >, you can leave it exactly like it is:>. Most people escape it as well but it is not necessary to do so, only less-than needs to be escaped.

When switching to the Author editing mode if the greater than was encoded as a simple character, it is kept as such, if it was encoded as the greater-than entity reference it is kept as an entity reference. In this way, when the XML is saved, Oxygen will know to encode greater-than exactly as it was encoded.

Ideally when working in the Text page you would only encode < as <, in this way in the Author visual editing mode both less-than and greater-than would appear as simple characters.

Regards,
Radu

Re: Conversion to entity in Author view

Posted: Wed Aug 13, 2014 2:53 am
by Eddie
Understood.

Thanks for the reply.

Ed.