Re: I propose the XML Schema 1.1 <assert> element support user-friendly diagnostic messages via the XPath trace() function

Andrew Welch <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
>             <xs:assert test="if (xs:time(start) lt xs:time(end)) then
>
>                                                      true()
>
>                                                else
>
>                                                       trace(false(), 'Hey,
> the meeting ends before it begins!')" />
>
...
> Notice that I am using the XPath trace() function. It the assertion fails, I
> would like the XML Schema validator to output this user-friendly diagnostic
> message:
...
> I propose that the XPath trace() function be overloaded in an XSD context to
> generate user-friendly error messages.

When I did a small test framework a while back I had any non true
value returned as the failure message, so you could do something like:

if (a > b) then true() else concat(a, ' is not greater than ', b)

If true() was returned the test passed, anything else would be a fail
and the value shown to the user.

Not much help here, but I just thought I'd mention it :)



-- 
Andrew Welch
http://andrewjwelch.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.