RelaxNG warnings

This should cover W3C XML Schema, Relax NG and DTD related problems.
kruncher
Posts: 26
Joined: Tue Mar 31, 2009 5:47 pm

RelaxNG warnings

Post by kruncher »

Hi,

One of the features I like about the Oxygen xml editor is that it highlights errors and warnings with different colours. Is it possible to have a RelaxNG schema produce a warning (instead of just all errors) with the yellow indicator?

Despite numerous searches on Google, I have been unable to find anything relating to warnings in RelaxNG.

Many thanks,
Lea Hayes
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: RelaxNG warnings

Post by george »

Dear Lea,

If the processor used for validation reports a warning then oXygen renders that with yellow, if the processor reports an error then it renders that with red. For Relax NG oXygen uses Jing through oNVDL and I also cannot think of a case when the processor will report a warning but if you obtain a warning that will be surely rendered with yellow in the editor.

Do you have a case when an error reported for Relax NG should be in fact just a warning?

Best Regards,
George
George Cristian Bina
kruncher
Posts: 26
Joined: Tue Mar 31, 2009 5:47 pm

Re: RelaxNG warnings

Post by kruncher »

Sorry for the delay in response.

Basically I wanted my own XML schema to indicate a warning instead of an error if the XML matches a certain criteria.

For example,

If an optional (but recommended) element is missing from an XML document I wanted to be able to display the warning indicator. Or if a value may not work correctly when transformed to a particular target. etc.

Code: Select all

<!-- Following would validate -->
<something>
<optional>Caption text...</optional>
<required>content</required>
</something>

<!-- Following would validate, but with 1 warning -->
<!-- Something like: It is recommended to include the "optional" element -->
<something>
<required>content</required>
</something>

<!-- Following would not validate with 1 error and 1 warning -->
<something>
</something>
I have the error part working fine, and for the moment I am just allowing the "warning" cases, but somehow I want to utilize the yellow-marker for warnings (if of course this is possible with RelaxNG and Oxygen).

Thanks George!
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: RelaxNG warnings

Post by george »

Hi,

You can use Schematron embedded in Relax NG and (you need to check this) diagnostics are reported as warnings.

Best Regards,
George
George Cristian Bina
Post Reply