Remove @type warnings from map validations using batch validate

Post here questions and problems related to editing and publishing DITA content.
Mauricio Marten
Posts: 4
Joined: Wed Sep 21, 2022 12:24 am

Remove @type warnings from map validations using batch validate

Post by Mauricio Marten »

Hello,

We want to remove the @type warnings when using the batch validation option in the DITA Map Completeness Check feature. An example of the warning is:

W [REF] Reference is made with inherited @type "concept" to a DITA resource with class "- topic/topic reference/reference ".

Is this something that can be done through the oxygen API or it has to be done on your end?

Thanks,
Mauricio
Radu
Posts: 8283
Joined: Fri Jul 09, 2004 5:18 pm

Re: Remove @type warnings from map validations using batch validate

Post by Radu »

Hi Mauricio,

I'm afraid we do not have a checkbox for this in the "Validate and check for completeness" settings dialog.
An Oxygen plugin can for example filter certain validation problems from being displayed:
https://github.com/oxygenxml/wsaccess-j ... lemsFilter
But my advice to you is to simply remove all "type" attributes from your DITA Maps as they are automatically inferred by the publishing engine when publishing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 652
Joined: Thu May 02, 2019 2:32 pm

Re: Remove @type warnings from map validations using batch validate

Post by chrispitude »

Hi Mauricio,

Are these @type attributes on <topicref> elements in a map, or on <xref>/<link> elements in a topic?
Mauricio Marten
Posts: 4
Joined: Wed Sep 21, 2022 12:24 am

Re: Remove @type warnings from map validations using batch validate

Post by Mauricio Marten »

Hi Radu,

Ok thanks I will look into that. We are currently using Oxygen 20.1 which has that option available:

batch-validate.PNG
batch-validate.PNG (30.97 KiB) Viewed 298 times

Thanks,
Mauricio
Mauricio Marten
Posts: 4
Joined: Wed Sep 21, 2022 12:24 am

Re: Remove @type warnings from map validations using batch validate

Post by Mauricio Marten »

chrispitude wrote: Wed Sep 21, 2022 1:48 pm Hi Mauricio,

Are these @type attributes on <topicref> elements in a map, or on <xref>/<link> elements in a topic?
Hi Chris,

Yes the @type attributes are on <topicref> elements in a map like this:

example.PNG
example.PNG (19.9 KiB) Viewed 297 times

Thanks,
Mauricio
Radu
Posts: 8283
Joined: Fri Jul 09, 2004 5:18 pm

Re: Remove @type warnings from map validations using batch validate

Post by Radu »

Hi Mauricio,

The "Batch validate DITA resources" checkbox in the "Validate and check for completeness" settings dialog does not influence this warning you are receiving in any way. My initial answer still stands, I recommend you remove the @type attributes from all of your DITA Maps.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Mauricio Marten
Posts: 4
Joined: Wed Sep 21, 2022 12:24 am

Re: Remove @type warnings from map validations using batch validate

Post by Mauricio Marten »

Radu wrote: Thu Sep 22, 2022 7:57 am Hi Mauricio,

The "Batch validate DITA resources" checkbox in the "Validate and check for completeness" settings dialog does not influence this warning you are receiving in any way. My initial answer still stands, I recommend you remove the @type attributes from all of your DITA Maps.

Regards,
Radu
Hi Radu,

Unfortunately it does not depend on me to remove those @type attributes. However thanks for the plugin code you provided which helped me remove those specific warnings during validation in this case.

Thanks,
Mauricio
Radu
Posts: 8283
Joined: Fri Jul 09, 2004 5:18 pm

Re: Remove @type warnings from map validations using batch validate

Post by Radu »

Hi Mauricio,

Usually in this case it's best to be consistent, either not use @type at all in the DITA Maps or use it in all places. To use it in all places, in the Oxygen Preferences->"DITA / Maps" page there is an "Always set values for the following attributes" section where you can check "Type".
Otherwise, coming back to the original error message:
Reference is made with inherited @type "concept" to a DITA resource with class "- topic/topic reference/reference ".
it means that the DITA Map has some content like this:

Code: Select all

<topicref href="concept.xml" type="concept">
       .....
	<topicref href="reference.xml"/>
</topicref>
So someone forgot to set the @type attribute on the "reference.xml" and the DITA standard says the type attribute cascades so the publishing engine will interpret the type of the "reference.xml" to be "concept" which is incorrect.
So another way to avoid such error messages is to fix them, to go to that specific topicref which does not have a @type attribute and add the type attribute to it.
Because with the problems filter plugin you are just sweeping the problem under the rug and the final publishing may also report such problems.

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