W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2011

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

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>
Message-ID: <9E51F88D5247B648908850C35A3BBB50053922EFAD@IMCMBX3.MITRE.ORG>
Hi Folks,

The <assert> element in here checks that the meeting start time is before its end time:

    <xs:element name="meeting">



                <xs:element name="start" type="xs:time" />

                <xs:element name="end" type="xs:time" />


            <xs:assert test="if (xs:time(start) lt xs:time(end)) then



                                                      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:

    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.

Received on Tuesday, 26 April 2011 10:36:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:19 UTC