Page 1 of 1

Suppressing conditional errors

Posted: Thu May 28, 2020 8:33 pm
by bloodnok
I get the following error during transformation

Code: Select all

[DOTX010E][ERROR]: Unable to find target for conref="#variables/llAirgap".
There's an understandable if annoying reason for the toolkit to throw the error: the variable it's complaining about is conditional and was excluded in this particular transform scenario.

Problem I'm trying to solve is how to suppress this specific error so that I can more easily see other unexpected errors. Because of where this variable exists, these error messages pollute my logs, making it really difficult to find the unexpected.

This has been a long-standing nit in DITA conditional processing: it throws an error about not being able to find an element that was deliberately excluded.

Any workaround for this nit is very welcome.

Re: Suppressing conditional errors

Posted: Fri May 29, 2020 7:07 am
by Radu
Hi,

Can you give me more details about how the actual DITA code looks like?
Do you have something like:

Code: Select all

<ph conref="..." audience="novice"/>
and you exclude "novice" audience using the filter, but still obtain the problem?
Or do you exclude only the target of the conref but not the source of the conref?

Regards,
Radu

Re: Suppressing conditional errors

Posted: Fri May 29, 2020 11:19 pm
by bloodnok
Fairly certain my scenario is like your first example. I've a variables.dita file with this entry:

Code: Select all

<ph id="llAirgap" props="AirGap">Air Gap </ph>
Other entries embed the above, for example:

Code: Select all

<ph id="llAnalyst"><ph conref="#variables/llAirgap"/>Analyst</ph>
The ditaval for the transform says:

Code: Select all

<prop action="exclude" att="props" val="AirGap"/>

Re: Suppressing conditional errors

Posted: Sun May 31, 2020 7:48 am
by Radu
Hi,

If you want to avoid seeing the error the filter attribute should go also on the attribute which has the conref:

Code: Select all

<ph conref="#variables/llAirgap" props="AirGap"/>
otherwise when the target element is filtered out, the conref can no longer be resolved and thus the error is reported. The error should not be a fatal one.
A trick might be to do this:

Code: Select all

<ph id="llAirgap"><ph props="AirGap">Air Gap </ph></ph>
in order to avoid removing the entire target element, but remove only its contents.

Regards,
Radu

Re: Suppressing conditional errors

Posted: Wed Jun 03, 2020 5:03 am
by bloodnok
What a fabulously simple solution!

Many thanks, Radu.