- From: Costello, Roger L. <costello@mitre.org>
- Date: Tue, 26 Apr 2011 06:35:58 -0400
- To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Received on Tuesday, 26 April 2011 10:36:26 UTC
Hi Folks,
The <assert> element in here checks that the meeting start time is before its end time:
<xs:element name="meeting">
<xs:complexType>
<xs:sequence>
<xs:element name="start" type="xs:time" />
<xs:element name="end" type="xs:time" />
</xs:sequence>
<xs:assert test="if (xs:time(start) lt xs:time(end)) then
true()
else
trace(false(), 'Hey, the meeting ends before it begins!')" />
</xs:complexType>
</xs:element>
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:
Hey, the meeting ends before it begins!
I propose that the XPath trace() function be overloaded in an XSD context to generate user-friendly error messages.
/Roger
Received on Tuesday, 26 April 2011 10:36:26 UTC