Ditamap validation configuration Check for duplicate IDs

Oxygen general issues.
KathrinH
Posts: 2
Joined: Thu Dec 10, 2015 9:36 pm

Ditamap validation configuration Check for duplicate IDs

Post by KathrinH »

Hello Oxygen Users,

I have upgraded to version 17.1 (from 16.1) and I am trying to validate my ditamap with the setting "Check for duplicate topic IDs within the DITA map context" turned off. However, no matter whether this option is checked or not, the validation result always returns all duplicate IDs.

Same map validated with oxygen version 16.1 filters out duplicate IDs in the validation step when the box is unchecked as expected.

Am I overlooking something?

Thanks for your help!
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ditamap validation configuration Check for duplicate IDs

Post by Radu »

Hi,

In Oxygen 16.1 there was an option called:

Check for duplicate element IDs within a topic

we removed that option because the specification states something like:

http://docs.oasis-open.org/dita/v1.2/os ... ec/id.html
Thus, within a single XML document containing multiple peer or nested topics, the IDs of the non-topic elements only need to be unique within each topic
so we considered there was no need to have an option for this.
Could you tell us more about your specific use-case?

Indeed in Oxygen 17.1 there is a new checkbox called:

Check for duplicate topic IDs withing the DITA Map context

but it is entirely unrelated to the older setting, it checks that all topic IDs should be unique in the entire DITA Map.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
KathrinH
Posts: 2
Joined: Thu Dec 10, 2015 9:36 pm

Re: Ditamap validation configuration Check for duplicate IDs

Post by KathrinH »

Understood. I didn't get the difference in meaning at first sight.

Thanks for your help.

Kathrin
rdelong
Posts: 72
Joined: Tue Oct 21, 2014 10:01 pm

Re: Ditamap validation configuration Check for duplicate IDs

Post by rdelong »

We have a situation where our IDs are created by the author. We were using anothe editor that did not automatically add the IDs, so it is possible, if the author didn't check the document for duplicate IDs, that there would be duplicates within the topic.

Duplicate IDs are a problem if we are creating conrefs that use an ID that happens to already exist in the referenced document. During runtime, the OT will throw an error/warning that the first ID was used to resolve the conref. However the author could be using the content from the element that contains the duplicate ID - the second element with the same ID. So, the output could be unexpected text.

For our purposes, we need a tool/method that will flag duplicate IDs. It would be nice if there was a menu button that would list the current IDs so that we can check the file before checking it into the repository. I was able to create a list by running

Code: Select all

//@id
from the XPath and get a list of IDs, but the list doesn't inform me that there are duplicates. I have to sort and search the list manually to test this. We don't typically work from a bookmap as we edit our documents. Some/most times I/we edit the topic as required from the CMS repository.

I'd like your feedback on the 1) menu button for listing existing IDs, and 2) provide a flag for duplicate IDs in a topic.

Thanks
rdelong
Posts: 72
Joined: Tue Oct 21, 2014 10:01 pm

Re: Ditamap validation configuration Check for duplicate IDs

Post by rdelong »

Radu wrote:Hi,

In Oxygen 16.1 there was an option called:

Check for duplicate element IDs within a topic

we removed that option because the specification states something like:

http://docs.oasis-open.org/dita/v1.2/os ... ec/id.html
Thus, within a single XML document containing multiple peer or nested topics, the IDs of the non-topic elements only need to be unique within each topic
so we considered there was no need to have an option for this.

Radu
This Oasis article also states,
The id attributes for topic and map elements are true XML IDs and therefore must be unique with respect to other XML IDs within the scope of the XML document that contains the topic or map element.
I'm confused why you would remove this option when the standard clearly states that the IDs must be unique with a topic or map.
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ditamap validation configuration Check for duplicate IDs

Post by Radu »

Hi Rich,

In DITA ID uniqueness checking should handle these two cases:

1) ID's set on the DITA <topic>, <task>, <concept> or <map> root elements (so IDs set on the DITA main type elements).
Indeed your quote applies to that:
The id attributes for topic and map elements are true XML IDs and therefore must be unique with respect to other XML IDs within the scope of the XML document that contains the topic or map element.
Because a new topic can be added to the end of an existing topic, their IDs must be unique in the context of the edited document. And Oxygen automatically checks this, either via "Validate and check for completness" or with automatic validation done when you are editing the topic or map.

2) IDs placed on sub-topic elements (<p>, <b>, <fig>, <section> etc). For these the specs states:
Thus, within a single XML document containing multiple peer or nested topics, the IDs of the non-topic elements only need to be unique within each topic
So these IDs need to be unique not in the entire document but in the context of the topic in which they appear.

For example in this case:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="t1">
<title>a</title>
<body>
<p id="pid"></p>
</body>
<topic id="t2">
<title>b</title>
<body>
<p id="pid"></p>
</body>
</topic>
</topic>
The two paragraphs have the same ID but they appear in different topic contexts so the entire document is valid.
But in this case:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="t1">
<title>a</title>
<body>
<p id="pid"></p>
<p id="pid"></p>
</body>
</topic>
the IDs of the paragraphs are no longer unique and Oxygen reports this as an error (either on automatic validation or when using the Validate and check for completeness action in the DITA Maps Manager View).

Coming back to the original thread discussion, in the Validate and check for completeness settings Oxygen had a checkbox which could disable this (2) case of uniqueness checking. We removed the checkbox and we always make this checking and report the error, so the checkbox can no longer be used to disable this validation checking.

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