Page 1 of 1

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

Posted: Thu Mar 22, 2018 12:33 am
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?

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

Posted: Fri Mar 23, 2018 2:41 pm
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

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

Posted: Fri Mar 23, 2018 6:57 pm
by jzucker
Thanks, Radu!

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

Posted: Mon Jun 18, 2018 4:21 pm
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