-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can no longer use conref in keydef metadata [DOT 2.3] #2420
Comments
Any hint in the specs about what stage should be applied first? Conref or keyref? |
@raducoravu: This was changed for 2.0 with #1631. From the Release Notes:
|
Because no order was specified way back in 1.0 the spec has had great difficulty giving a mandated processing order for any of the features. Even newer features have trouble, because giving an order like "Between existing features A and B" establishes an order for A and B. An additional complication is that while I think the spec implies you should evaluate keyref before conref, that doesn't rule out "evaluating" as a way of simply moving the conref from the map context into the topic. |
Somehow it seemed natural for me (speaking also as an end user) that the sample DITA content I gave should have worked, unfortunately even if I would use conkeyref instead of conref it will still not work. Looking at what the specs says about conref-ing to content which has a keyref in it: https://www.oxygenxml.com/dita/1.3/specs/archSpec/base/handling-xref-and-conref-within-topics.html
in my opinion this can no longer be accomplished because the keyrefs have been resolved in a previous stage. So having the keyref stage done before the conref stage does not comply with this paragraph in the specification. In my opinion maybe a solution would be do have a single stage in which conrefs and keyrefs are resolved. |
I think the cause may be that the key resolution module fails to verify a resolved topic has conrefs. |
My analysis is that the branch filtering and key scope features effectively require a specific order of processing and that implementations should do preprocessing in a "filtering aware" way. I captured this analysis in a dita-ot wiki page here: https://github.com/dita-ot/dita-ot/wiki/DITA-1.3-Preprocessing-Architecture-proposal |
This is something that would require processing keyref and conref in a loop when you keep on resolving them until no keyref or conref remains. It would be a large architectural change. |
Resolution of direct conrefs should be done before any key-based processing is performed, otherwise there is no way to ensure you get the right answer. Once key spaces are constructed it should then be possible to resolve key references in any context, including in the content of key defining-topicrefs. |
Ran into a variant of this issue today. The topic that uses the key actually has other uses of
I tried changing the reuse to |
Results now with 3.2.1 differ in a way that makes this more difficult to resolve: when the link text is resolved in the key, all sub-elements are dropped. This does make sense in some ways, but not in others. When I use Additional update: it looks like this could / should work better with I'm not sure how best to resolve this. Leaving the sub-elements in (with corrected Test files I'm working with now using 3.2.1: |
👍 We got one more report here: https://www.oxygenxml.com/forum/viewtopic.php?p=55127#p55094 |
Attaching samples for both situations (conref inside key definition and conkeyref inside key definition). Both do not work and as @robander said no error is reported and the text is just not present in the output. |
We have a client experiencing this issue. In the 2.4.3 OT, this resolves in PDF: In 3.2 OT, the keyref is dropped: However, in Oxygen 21.1 with the 3.x OT packaged, using the XSL-FO or CSS flavors of PDF, the keyref does resolve. Until this thread was pointed out to me, I thought it was something in the XSLT for the OT Plugin, especially since it worked in Oxygen 21.1 using the default Syncrosoft plugins. So, before I spend a lot of time and energy investigating the XSL for the plugin, Radu, is this something your team optimized in your Oxygen 21 package? If so, should I use that version of the OT in stead of the GitHub 3.2? |
@GlennEmerson this should not work even in Oxygen, I'm attaching a sample DITA project exemplifying my original problem. If your problem is different maybe you can also attach a small DITA project exemplifying it. |
I have a use case as well. We publish a document called Day One Impact Overview. This document essentially lists all features (product-wise) that impacts customers on the day 1 of the release. Each chapter in the map represents a product. The introduction topic contains a standard text and only the product names vary for each chapter. We want to create one single topic and utilize the DITA key scope to inject the relevant product name for each chapter during run time. Currently, we have stored all product names as Since If keys using |
I have a use case similar to GlennEmerson. I am trying to insert text based on a keyscoped keydef. Oxygen XML Editor 22.1 can resolve the reference to a keyref that is part of a keyscope (other than root) but DITA-OT looks for it in the root scope and I get the following error: [DOTJ047I] Unable to find key definition for key reference "myvalue" in root scope. The href attribute may be used as fallback if it exists I have attached a simple project that generates the error. When the keyref is not part of a conref, it is resolved correctly (proper keyscope). I am new to DITA but I believe that I used conref and keyref properly. |
Pasting here some of the advice I gave via email on the Oxygen Support email address to @sh511: As the "included_step.dita" is not referenced anywhere in the DITA Map, the publishing does not know in what keys context it is. Maybe you can refer to it in the DITA Map in that specific key scope:
As a best practice you should refer to all your topics containing reusable content in the DITA Map using the processing-role="resource-only" attribute which states that it does not contribute content to the table of contents and it's just a resource indirectly used. This gives a better indication to the publishing engine as to what resource are indirectly used. You can also declare the keyscope attribute higher on a parent element like this:
to avoid declaring it on each topicref. But there are also some bugs in the publishing engine related to conrefs and key scoped key references so thinks might not work precisely as you want all the time, you will need to check all your changes against the publishing engine. In your case I would have probably used conkeyref instead of conref, also declare the key scope only once and add all topicrefs inside the key scope, please see the sample project with my changes applied. |
Reproduced the original case. If you reference <keydef keys="company_name_full">
<topicmeta>
<keywords>
<keyword conref="abc.dita#abc/company_full"/>
</keywords>
</topicmeta>
</keydef>
<topicref href="abc.dita" processing-role="resource-only"/> |
@jelovirt oh so this is also related to the fact that with "preprocess2" all topics are now required to be referenced in the DITA Map. |
Fixed the case when a map uses a topic as a conref target but the topic is not referenced with a topicref. Partial fix for #2420. Signed-off-by: Jarno Elovirta <jarno@elovirta.com>
Fixed the case when a map uses a topic as a conref target but the topic is not referenced with a topicref. Partial fix for #2420. Signed-off-by: Jarno Elovirta <jarno@elovirta.com>
#4258 is a partial fix to this issue. You no longer need to reference conref targets separately with a <keydef keys="company_name_full">
<topicmeta>
<keywords>
<keyword conref="abc.dita#abc/company_full"/>
</keywords>
</topicmeta>
</keydef> you need to use <keydef keys="company_name_full">
<topicmeta>
<keywords>
<keyword><text conref="abc.dita#abc/company_full"/></keyword>
</keywords>
</topicmeta>
</keydef> |
@jelovirt maybe you can still close this issue as a partial fix. There have been quite a number of comments on this issue but the intent of the original issue has been about conrefs placed in keydef. |
Thanks @jelovirt |
If in my DITA Map I define a key which has a keyword with a conref to another one defined in a topic:
and in some topic I use the key:
it no longer gets expanded. Using DITA OT 1.8 the key got expanded.
The text was updated successfully, but these errors were encountered: