- From: Andrew Welch <andrew.j.welch@gmail.com>
- Date: Tue, 26 Apr 2011 12:23:12 +0100
- To: "Costello, Roger L." <costello@mitre.org>
- Cc: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
> <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
Received on Tuesday, 26 April 2011 11:23:40 UTC