File not found warning for <xref scope=external>

Questions about XML that are not covered by the other forums should go here.
dita-u1
Posts: 1
Joined: Tue Jan 12, 2016 12:05 pm

File not found warning for <xref scope=external>

Post by dita-u1 »

In a DITA document, I have <xref href=".././test.html" scope="external" format="html">Here</xref>

I get a warning on validation : W [REF] File not found C:\test\test.html


How do I turn off this validation error for scope="external"
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: File not found warning for <xref scope=external>

Post by alex_jitianu »

Hello,

For a DITA topic, the automatic validation performs a number of specific DITA-related checks but unfortunately these checks are not configurable. What you can do is remove this specific validation altogether (don't worry, you will still have the schema-based validation). Here is what you must do:
1. go to Options->Preferences... on page Document Type Associations and edit the DITA framework (or, if you are using another customized framework, edit that one instead).
2. in the Document Type edit dialog go to the Validation tab and edit the DITA scenario.
3. in the scenario edit dialog look at the Validation engine column and identify the entry which says DITA Validation. Remove it.

If you haven't yet changed in any way the default DITA framework shipped with Oxygen, you may want to Extend it instead of editing.

To compensate for the checks you lost, you can use from time to time the Validate and check for completeness action from the DITA Map Manager view. This action is configurable and you can tell it whether or not to check the existence of non-DITA references resources. As a matter of fact, I will add an issue to provide the same level of configuration for the DITA Validation performed automatically on a topic.

Best regards,
Alex
sanGeoff
Posts: 42
Joined: Mon Aug 18, 2014 11:50 pm

Re: File not found warning for <xref scope=external>

Post by sanGeoff »

You could also use ValidationProblemsFilter class in a plug-in right? If contains "File not found" and ends with ".html", remove. The vertical scroll area will still show the marks but they wont appear in the validation results.

Is it correct behaviour that the vertical area next to the right scroll bar and the file status area above the Text/Grid/Author buttons shows excluded validation problems? Seems like a small bug to me.
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: File not found warning for <xref scope=external>

Post by alex_jitianu »

Hello,

Good point, a ValidationProblemsFilter can remove unwanted error messages.
Is it correct behavior that the vertical area next to the right scroll bar and the file status area above the Text/Grid/Author buttons shows excluded validation problems?
The filter receives an ValidationProblems object which on the getValidationType() call return whether the validation is a manual one or an automatically triggered one. Perhaps you are looking at this flag and filtering only for the manual validation?

Best regards,
Alex
sanGeoff
Posts: 42
Joined: Mon Aug 18, 2014 11:50 pm

Re: File not found warning for <xref scope=external>

Post by sanGeoff »

Thanks for pointing out the getValidationType().
For some reason I was only checking NORMAL validation problems.
Works fine if I remove that condition from my plug-in.
Post Reply