[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath expression that generates false plus a messa

Subject: Re: XPath expression that generates false plus a message?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 25 Apr 2011 21:51:49 +0100
Re:  XPath expression that generates false plus a messa
I used the XPath expression within the new XML Schema 1.1<assert> element:

     <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) gt xs:time(end)) then
                                                       trace(false(), 'Hey, the meeting ends before it begins!')" />

Here is a<meeting> with bad data:


Your assertion is true if the start time is greater than the end time. Which is the case for your "bad" data.

(Note also that comparing times is an error-prone business: what happens if you have a meeting that starts at 23:00 and finishes at 01:00?)

Michael Kay

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.