Page 1 of 1
RelaxNG warnings
Posted: Wed Apr 22, 2009 7:15 pm
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
Re: RelaxNG warnings
Posted: Thu Apr 23, 2009 4:19 pm
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
Re: RelaxNG warnings
Posted: Tue Apr 28, 2009 10:39 pm
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!
Re: RelaxNG warnings
Posted: Wed Apr 29, 2009 8:22 am
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