Page 1 of 1

How does Oxygen keep auto-generated topic IDs unique?

Posted: Thu Feb 08, 2018 11:45 am
by laurakatajisto
We're producing DITA content which is located in multiple folders based on a product feature. Multiple authors are working on the project, and are responsible for their own folders.

We're hoping that we could use Oxygen's auto-generated topic IDs with these topics.

How does Oxygen keep the IDs unique? My team was wondering whether is it possible that the same topic ID could appear in two different folders.

Re: How does Oxygen keep auto-generated topic IDs unique?

Posted: Thu Feb 08, 2018 4:51 pm
by sorin_carbunaru
Hello,

There are probably very low chances to obtain 2 identical IDs. But, may I ask, why is it important for your team to have unique IDs everywhere? Please let us know your use-case.

IDs are usually needed for referencing elements, for creating links, but when you create a link between 2 documents, this is done by using either a URI or a key, not just the ID. When the URI-based method is used for a link between 2 files, the shortest form of the "href" can be "[filename]/[ID]", therefore it isn't mandatory for the ID to be unique in the context of the entire project.

Best wishes,
Sorin Carbunaru
oXygen XML

Re: How does Oxygen keep auto-generated topic IDs unique?

Posted: Fri Feb 09, 2018 4:04 pm
by laurakatajisto
It's more of a future-proofing thing than a real use case at the moment. Some discussions have been had whether certain potential publishing formats could autogenerate the name of the topic from the ID, but even in that case supplementing the ID with a suffix would help if duplicates are found.

Currently the ditamaps use URI since there's not much variation and no need for the added abstraction using keys.

Regards,
Laura

Re: How does Oxygen keep auto-generated topic IDs unique?

Posted: Wed Jul 22, 2020 8:17 pm
by AnalogKid82
Digging up this old topic. We recently validated a map and noticed an enormous number of errors for duplicate topic IDs.
I assume this is due to copying existing topics rather than creating new topics. Our topic filenames are unique, so we've not seen any linking issues, for example, that I can tell. Oxygen has the refactoring option to bulk-convert the IDs to use the topic filename, but wonder if this is even an concern. The DITA OT spec is somewhat loose about requiring topic IDs being unique. What issues could be run into if we do not change these IDs? Thanks!

Re: How does Oxygen keep auto-generated topic IDs unique?

Posted: Thu Jul 23, 2020 6:35 am
by Radu
Hi,

The DITA 1.3 specification mandates that topic IDs must be unique in the same file. So if you have an XML file with two DITA topics inside, those topics should not have the same ID. If your topics reside in different files, then according to the specification you can have all the IDs named "topicID" and there will not be any problem.
If you use the DITA Maps Manager's "Validate and check for completeness" action, it has a setting named "Check for duplicate topic IDs...." which by default is unchecked. Did you check it on your side?
The only benefits I see of having unique topic IDs in the entire DITA project is either because you may have a content management system that requires it (which would make it not 100% DITA standard compliant) or if you are using our Oxygen WebHelp context sensitive feature which by default uses the topic ID as a key:
https://www.oxygenxml.com/doc/versions/ ... itive.html
From what I've seen indeed most people seem to set the topic ID to be more or less the value of the file name, probably for consistency reasons, but this is not required by the DITA specs. Also the file name may not be unique, you may have multiple files with the same name in different folders.

Regards,
Radu