Determining overlapping comment end points in author

<oXygen/> general issues.
jtakeda
Posts: 7
Joined: Sat Feb 25, 2017 1:18 am

Determining overlapping comment end points in author

Post by jtakeda » Wed Jun 27, 2018 7:40 pm

Hi there,

In a project, we are using oXygen author mode comments to annotate bits of text; we then run the file through a transformation that takes all of the comment PIs and turns them into TEI anchor tags. However, one issue is that overlapping comments are ambiguous in respect to where they end:

Code: Select all

<p><?oxy_comment_start author="joey" timestamp="20180627T093505-0700" comment="I want to annotate this."?>Here <?oxy_comment_start author="joey" timestamp="20180627T093448-0700" comment="This word is a variant."?>is<?oxy_comment_end?> some<?oxy_comment_end?> text</p>
In the above sample, it's impossible to tell whether the first comment applies to "Here is" or to "Here is some" and whether the second comment refers to "is" or "is some".

I noticed that when you create a reply to a comment, the parent comment gets an id, the reply gets a pointer that points to the parent id and an @mid, and the end comment points to the @mid.

Is there a setting or way to give ids to all of the comments so that the end comment PIs point to the proper oxy_comment_start?

Thanks!

Best,
Joey

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

Re: Determining overlapping comment end points in author

Post by Radu » Thu Jun 28, 2018 7:55 am

Hi Joey,

The correspondence between start and end comments can be non-ambiguously decided.
The decision I made at that time (and it may not have been the perfect decision) was to only add "mid" attributes when necessary.
For example, the alternative to your posted TEI sample is this one:

Code: Select all

        <p><?oxy_comment_start author="radu_coravu" timestamp="20180628T074713+0300" comment="C1"?>Here
<?oxy_comment_start author="radu_coravu" timestamp="20180628T074721+0300" comment="C2" mid="3"?>is<?oxy_comment_end?>
some text<?oxy_comment_end mid="3"?></p>
Because in this case the first comment spans over the second one, the second start and end comments get an explicit "mid" linking them together.
So:

1)If you encounter an end comment without a mid, its pair is found by iterating left and searching for the first start comment without a mid.
2) If you encounter an end comment with a mid, its pair is found by iterating left and searching for the first start comment with the same mid.

Actually there is a plugin for generating change tracking from DITA content using an XSLT extension which may inspire you:

https://github.com/oxygenxml/dita-class ... iew/review

The XSLT stylesheet "review-pis-to-elements.xsl" converts all Oxygen processing instructions to elements in a special namespace.
The XSLT "review-group-replies.xsl" tries to make some fixes and group all replies.
And the XSLT "review-elements-to-html.xsl" tries to produce HTML.

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

nkutsche
Posts: 1
Joined: Wed Feb 25, 2015 5:10 pm

Re: Determining overlapping comment end points in author

Post by nkutsche » Thu Jul 04, 2019 1:02 pm

Hi Radu,

I just found this, because we have started to work on handling Oxygen PIs in several projects.

I think the logic you discribed is not 100% correct:
1)If you encounter an end comment without a mid, its pair is found by iterating left and searching for the first start comment without a mid.


At least in my Oxygen (20.1) it is possible to create nested comments like this:

Code: Select all

[comment_1]comment with with [comment_2]includeing[/comment_2] comment[/comment_1]
This was pseudo code. With real Oxygen PIs it looks like this:

Code: Select all

<?oxy_comment_start author="Nico" timestamp="20190704T112447+0200" comment="wrapper comment"?>comment with <?oxy_comment_start author="Nico" timestamp="20190704T112459+0200" comment="including comment"?>including<?oxy_comment_end?> comment<?oxy_comment_end?>
As you see the Oxygen does not create IDs for the PIs. So as far as I understand the logic is much more complex. As far as I understand, it works like an XML markup: each ending PI closes the last open starting PI. Only if the PIs needs other rules, it is done by IDs.

Am I correct?
Or are there differences between the Oxygen versions?

By the way, I will create also an issue on the refered DITA-Plugin project, as it does also not produce the expected result.

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

Re: Determining overlapping comment end points in author

Post by Radu » Fri Jul 05, 2019 12:51 pm

Hi Niko,

Your remark is correct:
As far as I understand, it works like an XML markup: each ending PI closes the last open starting PI. Only if the PIs needs other rules, it is done by IDs.
when I have a final fix I will close the issue you added on the GitHub project.

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

Post Reply