audience filter behavior when ditaval file is not found during publishing

Post here questions and problems related to editing and publishing DITA content.
pclaeys
Posts: 2
Joined: Fri Apr 28, 2023 1:07 pm

audience filter behavior when ditaval file is not found during publishing

Post by pclaeys »

I'm building webhelp output (using v25.1), and I use DITAVAL files to filter on the audience attribute.

When, during the build the file reference to a ditaval file is invalid, an error is printed. Here, I intentionally renamed the ditaval file to reproduce it
So, I see an error in the build output
[ditaval-merge] [DOTJ071E][ERROR] Cannot find the specified DITAVAL 'file:/C:/..........................l'.
But instead of aborting, the build just continues. No audience filter is applied. I don't want this behavior, because I might accidently expose too much information or incorrect information due to the missing audience filter.

I'm looking to:
- either: make the build abort on this error; instead of continuing
- or can I specify a default / fallback audience value (in the ditamap) ? I would set this to a default that excludes everything ; and will easily spot that the output is mostly empty.

Any known ways to achieve this?

fragment of the .framework file:

Code: Select all

<field name="filters">
	<ditavalFilters>
		<field name="useDitavalFilePath">
			<Boolean>true</Boolean>
		</field>
		<field name="useAppliedConditionSet">
			<Boolean>false</Boolean>
		</field>
		<field name="appliedConditionSet">
			<null/>
		</field>
		<field name="ditavalFilePath">
			<String>${pd}/ditaval/mistake_so_file_does_not_exist.ditaval</String>
		</field>
		<field name="simpleFiltersList">
			<list/>
		</field>
	</ditavalFilters>
</field>
chrispitude
Posts: 922
Joined: Thu May 02, 2019 2:32 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by chrispitude »

Hi pclaeys,

I also think that a missing DITAVAL file is serious enough that it should stop the transformation.

I tried setting the processing-mode parameter to strict and I was surprised that this did not stop the transformation. Can you try it on your side and confirm? Perhaps it's a DITA-OT bug.

There is some discussion here about implementing a way for the user to control the severity of individual message types:

#3922: Changing severity and intentionally failing builds

I suggest joining this discussion and sharing your experiences. The more the DITA-OT developers see a need for improvement in this area, the more likely it is we will get it. :)
Radu
Posts: 9473
Joined: Fri Jul 09, 2004 5:18 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by Radu »

Hi,

Thanks for the report, I would also agree than in such a case the transformation should stop.
I added an internal issue to look into this on our side, pasting the issue ID below for future reference:
OPE-161 Transformation should stop when path to ditaval is invalid

About this remark:
- or can I specify a default / fallback audience value (in the ditamap) ? I would set this to a default that excludes everything ; and will easily spot that the output is mostly empty.
There is a DITA 1.3 feature named branch filtering which allows adding a reference to the DITAVAL file directly on the DITA Map root element.
https://blog.oxygenxml.com/branchFilter ... ilter.html
But that would not be a fallback filter, it would be always used and also it would imply using key scopes and key references to refer between topics.
So the short answer would be no :)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pclaeys
Posts: 2
Joined: Fri Apr 28, 2023 1:07 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by pclaeys »

Thanks for the replies.
I also tried to run with processing-mode 'strict', and indeed it happily continues instead of aborting as one would expect on strict.

I'll make a comment in the other mentioned thread as well, so others can also find this info if they would run into it.
Radu
Posts: 9473
Joined: Fri Jul 09, 2004 5:18 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by Radu »

Hi,
Thanks, I also added an internal Oxygen issue because one thing we could do would be to maybe check if the ditaval reference points to an existing file before the publishing is started. So the problem could be fixed either in the Oxygen code (before starting the DITA OT) or in the DITA OT code.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 922
Joined: Thu May 02, 2019 2:32 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by chrispitude »

Hi Radu,

Hopefully any such improvements would apply to the Oxygen Publishing Engine as well as to Oxygen itself!
Radu
Posts: 9473
Joined: Fri Jul 09, 2004 5:18 pm

Re: audience filter behavior when ditaval file is not found during publishing

Post by Radu »

Hi Chris,
Makes sense, especially that you are using DITA OT project files which define the filter inside them so Oxygen would not be able to perform the checks right when starting the publishing. I will write your remark on the opened issue.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply