Issue with the "insert.olink" action?

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
csun
Posts: 29
Joined: Wed Dec 20, 2017 9:56 pm

Issue with the "insert.olink" action?

Post by csun » Fri Oct 04, 2019 1:17 am

Hi,

With a DocBook 5 framework opened in Oxygen Author 21.0, it seems that if the action "insert.olink" is performed (which executes the operation ro.sync.ecss.extensions.docbook.olink.InsertOLinkOperation), it would display an error message in case the <xreftext> of the target includes characters such as &amp; or &lt;. For example:
<xreftext>a &amp; b</xreftext>
or
<xreftext>a &lt; b</xreftext>

The error messages for the above are, respectively,
"Could not insert document fragment. Cause: The entity name must immediately follow the '%26' in the entity reference."
and
"Could not insert document fragment. Cause: The content of elements must consist of well-formed character data or markup."

(By the way, if the <xreftext> contains &gt; the "insert.olink" action works fine.)

Is this caused by a bug with the implementation of ro.sync.ecss.extensions.docbook.olink.InsertOLinkOperation ?

Thanks,
Charles

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Re: Issue with the "insert.olink" action?

Post by Radu » Fri Oct 04, 2019 9:12 am

Hi Charles,

Thanks for the report, I added an internal issue for it. I looked a little bit in our code and indeed this looks like a bug on our side.
By the way, as a side note it is not necessary to escape the ">" character in XML, only the "<" is illegal to be inserted directly in XML text.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

csun
Posts: 29
Joined: Wed Dec 20, 2017 9:56 pm

Re: Issue with the "insert.olink" action?

Post by csun » Fri Oct 04, 2019 5:34 pm

Hi Radu,

Thanks for looking into this.

If I understand correctly, the fix be released with a future version of Oxygen. Before that happens, is there a workaround you would recommend, by any chance?

I think one workaround is to check off the "Insert xreftext in the Olink" box while in the "OLink" dialog, and then manually type in (or copy-paste) the link text in the XML. But if you know a better workaround, I'll be interested to learn about it.

Thanks!
Charles

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Re: Issue with the "insert.olink" action?

Post by Radu » Mon Oct 07, 2019 9:38 am

Hi Charles,

Other than what you mentioned I do not have another workaround.

The issue I added for this has internal ID EXM-44297, we'll fix the problem in Oxygen 22 (January 2020) but if this is important for you I can also try to add a fix for the next Oxygen 21.1 minor bug fix release (hopefully we can make another bug fix release in one month or so depending on how many issues we fixed on it).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply