Author Mode Comments (created PI)

Are you missing a feature? Request its implementation here.
mathias
Posts: 1
Joined: Mon Jun 25, 2018 4:40 pm

Author Mode Comments (created PI)

Post by mathias »

Hi folks,
we are using the Author Mode and its "comment" functionality to overcome some issues with overlapping encoding. The created PIs

Code: Select all

<?oxy_comment_(start|end)?>
are a kind of a workaround for encoding semantics spanning over several elements. While front end side everything looks fine, and this solution offers everything we need, we are facing some troubles processing the result when multiple of theses comments are set.

see this example (fragment):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<root>
<ab>
    <seg xml:lang="ara">١٣܆</seg>
    <?oxy_comment_start author="name" timestamp="20200827T181711+0200" comment="wise_fool_sinful"?>
    <?oxy_comment_start author="name" timestamp="20210319T180034+0100" comment="adherence_wisdom"?>
    <?oxy_comment_start author="name" timestamp="20210319T180048+0100" comment="social_contacts_no_family" mid="30"?>
    <quote next="#say14.sprN4">ܒܪܝ ܐܬܕܰܒܩ ܠܐܢܼܫ̈ܐ ܚܟܝܡ̈ܐ ܕܬܗܘܐ ܚܟܝܡ ܐܟܘܵܬܗܘܢ܂ ܘܠܐ</quote>
</ab>
<ab><quote xml:id="say14.sprN4">ܬܬܢܰܩܰܦ ܠܐܢܫ̈ܐ ܣܟ̈ܠܐ ܕܕܰܠܡܐ ܬܐܠܦ ܡܼܢ
    ܐܘܪ̈ܚܵܬܗܘܢ܀<?oxy_comment_end?><?oxy_comment_end mid="30"?></quote><?oxy_comment_end?></ab>
</root>
It represents the result of a valid "comment" annotation prepared with the author mode. For the encoder, in this case it is impossible to set end point before of after a certain end tag, since these are not displayed (what is a valid set up and should not interfere with our workflow). But there is no chance to determine the corresponding start-PI for both end-PIs w/o the "mid-attribute".

possible solution:
set a unique ID for the start and the end PI in an appropriate "attribute". Alternatively this can be done with the timestamp for example. When the timestamp will be added to the

Code: Select all

<?oxy_comment_end?>
we can navigate to the start PI without any troubles.

for TEI folks: yes, the comments we are creating behave like tei:milestone, but for convenience we want to use the comment functionality of the author mode here.

thank you very much and kind regards,
mathias

edit: here is a more unpleasant example.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <!-- starting comments above -->
    <ab>
        <cit type="paraphrase" xml:id="say12x">
            <quote xml:id="say12.1">ܠܓܲܒܼܪܵܐ ܦܲܟܵܢܵܐ <choice>
                    <sic>ܘܠܸܫܵܢܵܢܵܐ</sic>
                    <corr resp="#SB">ܘܠܸܫܵܢܵܐ</corr>
                </choice> ܕܠܵܐ ܬܵܬܼܡ̱ܢܹܐ ܥܲܡܹܗ܀</quote>
            <note type="original-phrase">ܕܡܗܠܟ ܥܡ ܚܟܝܡܐ ܢܗܘܐ ܚܟܝܡ܂ ܘܕܡܗܠܟ ܥܡ ܣܟܠܐ ܢܒܐܫ ܠܗ܂</note>
            <bibl type="provided-by-editor" source="#Peshitta_Prov_Eccl_etc">Prov 13,20.</bibl>
        </cit><?oxy_comment_end?><?oxy_comment_end mid="29"?><?oxy_comment_end mid="30"?>
        <?oxy_comment_start author="name" timestamp="20201103T163428+0100" comment="richness_poverty"?>
        <?oxy_comment_start author="name" timestamp="20210317T150448+0100" comment="disciplining_of_sons"?>
        <quote next="#say13"> ܒܹܪܝ ܥܲܕ ܐܝܼܬܼ</quote>
    </ab>
    <ab>
        <quote xml:id="say13">ܡܣܵܢܹ̈ܐ ܒܪܸ̈ܓܠܲܝܟ ܕܘܼܫ ܕܲܪܕܪ̈ܐܹ܉ ܘܲܥܒܸܕ ܐܘܼܪܚܵܐ ܠܲܒܼ̈ܢܲܝܟ
            ܘܠܲܒܼ̈ܢܿܝ</quote>
    </ab>
    <ab>
        <quote xml:id="say13.1">ܒ̈ܢܲܝܟ܀<?oxy_comment_end?></quote>
        <quote next="#say14"> ܒܹܪܝ ܒܲܪ ܥܲܬܿܝܼܪܹ̈ܐ ܐܸܟܲܠ ܚܸܘܝܵܐ܉ ܘܐܵܡܪܝܼܢ ܠܐܵܣܝܘܼܬܼܵܐ
            ܐܲܟܼܠܹܗ܂</quote>
    </ab>
    <ab>
        <quote xml:id="say14">ܘܐܲܟܼܠܹܗ ܒܲܪ ܡܸܣ̈ܟܹܿܢܹܐ܉ ܘܐܵܡܪܝܼܢ ܕܲܠܟܲܦܢܹܗ ܐܲܟܼܠܹܗ܀</quote><?oxy_comment_end?>
        <?oxy_comment_start author="name" timestamp="20201103T172943+0100" comment="social_contacts_no_family"?>
        <quote next="#say15"> ܒܹܪܝ ܐܲܟܼܘܿܠ</quote>
    </ab>
    <!-- ending comments below -->
</root>
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Author Mode Comments (created PI)

Post by alex_jitianu »

Hello,

When comments overlap we use the @mid attribute to distinguish among them.
For the encoder, in this case it is impossible to set end point before of after a certain end tag, since these are not displayed (what is a valid set up and should not interfere with our workflow)
The encoder is a person that looks over the document and needs to transform these PIs into TEI markup?

A possible workflow over the current PIs structure is like this:
- you first analyze the PIs that have the @mid attribute set. After you do what you must do, you remove the corresponding oxy_comment_start and oxy_comment_end markers.
- all the comments that remain are no longer overlapping. To identify the end marker, you can put the caret on a start marker and run an XPath like this one. Because the overlapping comments are gone, we don't need to exclude them from the XPath, but I imagine one could refine an XPath expression that ignores them.

Code: Select all

for $x in  count(following::processing-instruction('oxy_comment_start')[not(preceding::processing-instruction('oxy_comment_end'))])

return following::processing-instruction('oxy_comment_end') [$x + 1]
I agree that it would be a lot easier to process these PIs if the @mid attribute would always be present.

Best regards,
Alex
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author Mode Comments (created PI)

Post by Radu »

Hi,

Adding here also a link to a project we have which uses XSLT to handle Oxygen review processing instructions for HTML and PDF publishing: https://github.com/oxygenxml/dita-class ... iew/review

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