Page 1 of 1

custom error msg for XSD assert

Posted: Tue Mar 31, 2015 2:13 pm
by vlindhol
(I debated with myself whether to post here or in the XML Schema forum, but since this seems to be a nonstandard, Oxygen-specific feature I put it here.)

I'm trying to produce an easier to read error message for an XSD assertion that I have in place for an XML schema of mine. I found in the Oxygen manual that this is possible using a validator-specific feature (http://www.oxygenxml.com/doc/ug-editor/ ... sages.html).

As is mentioned in the manual, I have imported the Xerces namespace and have put a message attribute in my assertion:

Code: Select all

<assert test="someTest" xerces:message="Custom error message"/>
But the message never shows up, only the default technical one. Is this feature supported anymore?

Re: custom error msg for XSD assert

Posted: Tue Mar 31, 2015 3:24 pm
by tavy
Hello,

Yes, is possible to specify a custom error message for an assert. But there is a small problem with the namespace that we specified in the user manual for Xerces messages. The namespace declaration for Xerces messages should be xmlns:xerces="http://xerces.apache.org", not "http://xerces.apache.org/".

This is not an Oxygen specific feature, is more like a processor specific feature. So, you can use it in any application that has that validation processor.

Regards,
Octavian

Re: custom error msg for XSD assert

Posted: Tue Mar 31, 2015 4:27 pm
by vlindhol
Ah, there we go! Removing the slash from the URL made all the difference. Thanks!