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

RE: assertion failures - providing feedback

From: Michael Kay <mike@saxonica.com>
Date: Thu, 14 Feb 2008 17:10:15 -0000
To: "'Andrew Welch'" <andrew.j.welch@gmail.com>, <xmlschema-dev@w3.org>
Message-ID: <01e501c86f2c$77ba4780$6401a8c0@turtle>

Given that XML Schema doesn't provide any facilities for customising error
messages anywhere else (e.g. for failures to match the grammar of a complex
type, failure to match a regular expression, key/keyref failures, etc) do
you think there is a good case to treat assertions differently? Or is it
just an expectation that comes from what Schematron does?

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Andrew Welch
> Sent: 14 February 2008 16:47
> To: xmlschema-dev@w3.org
> 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 17:10:29 GMT

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