W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2008

Re: assertion failures - providing feedback

From: Pete Cordell <petexmldev@codalogic.com>
Date: Thu, 14 Feb 2008 18:21:52 -0000
Message-ID: <001001c86f36$7a4fb3e0$fc00a8c0@Codalogic>
To: "Andrew Welch" <andrew.j.welch@gmail.com>, <xmlschema-dev@w3.org>

An xs:assert does seem to allow an xs:annotation.  Does that help?  I guess 
it might help the developer, but you'd have to make assumptions about the 
contents of the text before you displayed it to a regular user.

And if you're going to display messages embedded in the XML schema to a 
user, what's the effect of internationalisation / localisation of such error 
messages?  Would the messages need to be parameterized in the general case?

Regards,

Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/ for XML C++ data binding

----- Original Message ----- 
From: "Andrew Welch" <andrew.j.welch@gmail.com>
To: <xmlschema-dev@w3.org>
Sent: Thursday, February 14, 2008 4:46 PM
Subject: assertion failures - providing feedback


>
> What is the intended way to provide feedback when an assertion fails?
>
> Given:
>
> <xs:assert test="@min le @max"/>
>
> How would you say "The min attribute must be less than or equal to the
> max attribute" when the test fails?
>
> I hope it's not:
>
> <xs:assert test="if (@min le @max) then true() else
> error('http://mycomp.com', 'myerr:minlessthanmax', 'The min attribute
> must be less than or equal to the max attribute')"/>
>
>
>
> thanks
> -- 
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
>
> 
Received on Thursday, 14 February 2008 18:22:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:02 GMT