Suppress the creation of #id when referencing topics using the Cross Reference (xref) Dialog Box

Post here questions and problems related to oXygen frameworks/document types.
jzucker
Posts: 4
Joined: Wed Oct 15, 2014 10:22 pm

Suppress the creation of #id when referencing topics using the Cross Reference (xref) Dialog Box

Post by jzucker »

Hello,

I have a question about the automatic inclusion of the #ID when inserting a cross-reference link to another topic (for example: sample.dita#sample-id1234) when using the Cross Reference (xref) Dialog Box.

When linking to a topic, is there a way to turn off the automatic generation of the ID in the reference link for topics only?

For example, instead of creating a reference that looks like this:
<xref href="sample.dita#sample-id1234">

We want the reference to look like this for topic-level references only:
<xref href="sample.dita">

This request is to support an internal publishing system requirement. Is this behavior customizable in the Editor for users who use the Cross Reference (xref) Dialog Box?
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Suppress the creation of #id when referencing topics using the Cross Reference (xref) Dialog Box

Post by Radu »

Hi Joe,

We do not have a setting for this, both forms are equivalent according to the DITA specs although I do agree that removing that topic ID when inserting the xref is cleaner. I will add an issue on our side, maybe we can implement this as a default behavior. I'll update this forum thread when we do.
Possible current workarounds:
1) Drag and dropping topics from the DITA Maps Manager view inside a current opened DITA topic should insert an xref without that topic ID set on it.
2) Insert an empty xref using Oxygen's content completion window, then use our "ALT-ENTER" "Edit Attributes" action to set an href on it.
3) Copy (Ctrl-C) a topic in the Project view or from the Windows Explorer and then in an opened DITA topic right click and choose "Smart paste"->"Paste as reference".
4) Use our Oxygen Java-based SDK along with our API to create an Oxygen plugin which would add a custom filter called when Oxygen is about to insert that xref, giving you a hook to change the @href attribute:

https://www.oxygenxml.com/doc/versions/ ... marks.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Suppress the creation of #id when referencing topics using the Cross Reference (xref) Dialog Box

Post by sorin_carbunaru »

Hello Joe,

Just wanted to let you know that we addressed the issue you reported in the recently released oXygen 20.1.

All the best wishes,
Sorin Carbunaru
oXygen XML
Post Reply