Page 1 of 1

Inserting indexterm in title element

Posted: Thu Jul 18, 2024 12:51 am
by tmakita
Here is question from my user.
We know that DITA DTD does not allow indexterm element in title element. When I push enter key in title element, Oxygen displays indexterm as graying out.
スクリーンショット-2024-07-18-060523_New.png
If I select indexterm and push enter key, Oxygen inserts p element with indexterm after title element. (Oxygen is clever!)
スクリーンショット-2024-07-18-060614.png
スクリーンショット-2024-07-18-060630.png
But my user uses his own DTD. When I test above in user's DTD, Oxygen inserts equation-inline/indexterm in title element.
スクリーンショット-2024-07-18-061435.png
スクリーンショット-2024-07-18-061504_New.png
The question is this behavior. My user does not prefer equation-inline element inserted in title element.
How does Oxygen selects alternative element to avoid indexterm inserted as title children?

Re: Inserting indexterm in title element

Posted: Thu Jul 18, 2024 6:58 am
by Radu
Hi Toshihiko,
We have quite a lot of code dealing with what Oxygen should do when elements which do not belong somewhere are inserted in that specific part of the document. The strategies may move the element somewhere else, they may wrap the element in another element which is allowed, they may remove the element's XML tag and leave only its inner text at the insertion offset. I'm afraid we do not have a document where to detail all this, and the end result may depend on various weights we have in our code for each possibility to make the document valid again.
In this case probably Oxygen chooses equation-inline because it is the first tag in alphabetical order which allows for <indexterm> inside it. I do not know why it no longer chooses to create that paragraph with the indexterm after the title, possibly because your client has specific changes in the DTDs to prohibit adding <p> elements inside a <fig>... but I do not know the specifics of your client's DITA DTD specialization.
Regards,
Radu

Re: Inserting indexterm in title element

Posted: Thu Jul 18, 2024 7:20 am
by tmakita
> possibly because your client has specific changes in the DTDs to prohibit adding <p> elements inside a <fig>
Your guess is absolutely right!
Thank you very much.

Re: Inserting indexterm in title element

Posted: Fri Sep 27, 2024 7:13 am
by tmakita
Hi Radu,
> We have quite a lot of code dealing with what Oxygen should do when elements which do not belong somewhere are inserted in that specific part of the document.
Is there any configuration option to disable displaying candidate elements that are not valid in (specialized) DTD?
Our user is testing authoring via XML Author and above request is very important one.
Regards,

Re: Inserting indexterm in title element

Posted: Fri Sep 27, 2024 7:14 am
by tmakita
Hi Radu,
> We have quite a lot of code dealing with what Oxygen should do when elements which do not belong somewhere are inserted in that specific part of the document.
Is there any configuration option to disable displaying candidate elements that are not valid in (specialized) DTD?
Our user is testing authoring via XML Author and above request is very important one.
Regards,

Re: Inserting indexterm in title element

Posted: Fri Sep 27, 2024 8:33 am
by Radu
Hi Toshihiko,
Indeed by default Oxygen's content completion window in the Author mode displays all possible elements and Oxygen attempts to figure out where to insert elements which are not allowed at the caret position.
In the Oxygen Preferences->"Editor / Edit Modes / Author / Schema-Aware" page there is a "Show all possible elements in the content completion list" checkbox which can be unchecked. Is this close to what you want to achieve?
Regards,
Radu

Re: Inserting indexterm in title element

Posted: Fri Sep 27, 2024 9:41 am
by tmakita
Thank you!
It works as expected :D