Page 1 of 1

Understanding Validation Options

Posted: Fri Sep 24, 2021 1:44 am
by jlm80249
Hello-
I'm wondering if we might be missing some markup or possibly a setting regarding use of keys and validation.

We are using a keymap to define all our topics, but the keymap is not specific to just the map we are validating from, it's a keymap for all topics within a collection of folders. So, we will have way more keys defined in our keymap than what we referencing in our map. When I try to validate the map, it appears that the validation is happening for every key defined in the keymap, not just the keys referenced in the map. I am trying to run validation from the Ditamaps manager with the map open in the maps manager as well as the map set to the current context. I have take some of your sample files from the Oxygen Install location, to show this example with data. To recreate:

Open the flowers.ditamap in the Ditamap Manager View and set this map as the context.
Run the validation.

This flowers.ditamap has around 10 topics in it. But when I try to validate, the validation tool is validating around 25 resources, which is all the topics defined in the keymap. All keys defined in the keymap are not used in flowers.ditamap, and we want to only be able to validate against only the references used in the flower.ditamap.

I'm also trying to attach my zip which is only 350KB and it says the file is too large. How can I send this sample?

Thanks!
Jenny

Re: Understanding Validation Options

Posted: Fri Sep 24, 2021 8:11 am
by Radu
Hi Jenny,

We have a tech support form on which you can attach a zip with up to 200MBs:
https://www.oxygenxml.com/techSupport.html

Coming back to your problem, I'm testing with Oxygen 23.1, what version of Oxygen are you using?

If in Oxygen XML Editor in the DITA Maps Manager I open the "flowers.ditamap", then in the "Context" drop down combo I add a reference to the Oxygen user's guide DITA Map which is huge with lots of keys and resources:
https://github.com/oxygenxml/userguide/ ... al.ditamap

then I use "Validate and check for completeness" in the DITA Maps Manager, Oxygen validates about 18 files (the files in the flowers.ditamap) and reports that the keys are not found (because it uses the keys from "userguide.ditamap" while flowers.ditamap references other key names instead).
So this works for me.

But I think your case is probably different, in your case to build upon the previous example the "flowers.ditamap" has a topic reference to the "userguide.ditamap", something like:

Code: Select all

<topicref href="userguide/DITA/UserManual.ditamap" format="ditamap" processing-role="resource-only"/>
Indeed in this case the "Validate and check for completeness" will go recursively through the entire contents of the "UserManual.ditamap".
Is this closer to your case?

Regards,
Radu

Re: Understanding Validation Options

Posted: Fri Sep 24, 2021 8:02 pm
by jlm80249
Hi!

Thank you so much for your help! I am using: XML Author 23.0, build 2020121712

Your second scenario is not quite the case I am describing, but it makes sense that if I have a reference within my map to another map, that it recurses and validates all referenced maps and resources too.

In my scenario, I have one main map...flowers.ditamap. In my flowers map, I have 11 topicrefs elements. I have replaced the href values in these 11 topicrefs with keyrefs. The keys are defined in KEYS_flowers.ditamap. KEYS_flowers.ditamap is referenced from my flowers.ditamap so that my topicref keyrefs can resolve. My KEYS_flowers.ditamap ONLY has key definitions inside, and it has more key definition elements than keyrefs are actually present in flowers.ditamap. When I go to validate my flowers.ditamap, I want validation to only check the references inside flowers.ditamap, and not the unused key definitions defined in KEYS_flowes.ditamap. Is there are way to accomplish this? Maybe some markup I am missing or placement of my Key definition map?

I have uploaded my files to the URL you provided with a reference back to this topic.

Thank you!

Re: Understanding Validation Options

Posted: Sat Sep 25, 2021 1:35 am
by jlm80249
Hi-
Thanks for your reply! I went ahead and submitted my samples through the support link. And somehow when I responded in this thread, it's not showing up. So here is my reply again.

Our case is that we are not using href values in any of our topicrefs. We are using keyrefs for all topicrefs. We have one master key definition file that defines keys for all of our topics in a collection. And we make ditamaps with topicrefs using keyref values. However, our key definition map will define a lot more keys for topics, that ever exist in a single ditamap. In the flower example I sent, I have 11 topicrefs defined in the flowers.ditamap, and in the flowers keymap, I have more than 20 key definitions defined for topics. I have to reference the flowers keymap in my flowers ditamap, so the keys can properly resolve. But when I validate my flowers.ditamap, I would like to only validate against the topics that are defined in the flowers.ditamap. Instead, the validation is trying to validate all topics defined in the keymap, which includes topics that don't even exist in the ditamap. Is there a way to control this so validation only happens on references defined in the flowers.ditamap? Or is there a different way to reference our keymap so that it's not treated as a mapref and hence, recursed as part of the validation?

Thanks!

Re: Understanding Validation Options

Posted: Mon Sep 27, 2021 8:36 am
by Radu
Hi Jennifer,

About your post not appearing, as you are a new poster on your forum, all your posts go through a manual approval process, but as you will write more on the forum, at some point the forum will mark you as a verified user and your posts will appear faster.
Coming back to your sample posted via our tech support form, thanks, we received it.
So you want Oxygen not to validate topics which have keys defined for them, but the keys are not used anywhere else in the DITA Project, like for example the "chrysantemum.dita" has a key defined for it but it's not used anywhere else, so Oxygen should skip validation for it. I'm afraid we do not have a setting to accomplish what you want. I added an internal issue to consider this for a future version, attaching the issue ID below:

EXM-48877 Validate and check for completeness - avoid reporting errors in unused key defs

I think it would make sens to have such a setting so if we manage to add it in a future version we'll update this thread..

The only workaround I would see now would be to have multiple DITA Maps defining keys and refer in the main DITA Map only the DITA Maps with keys which are actually used. The "Validate and check for completeness" does have a checkbox named "Report unreferenced key definitions" which could be used to locate all such keys and maybe extract their definitions in a separate DITA Map.

Regards,
Radu

Re: Understanding Validation Options

Posted: Mon Sep 27, 2021 5:09 pm
by jlm80249
Thank you!! And I really appreciate that you are considering this as an option in the future!!!