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

Re: XPath expression for checking that an xs:duration

Subject: Re: XPath expression for checking that an xs:duration value is not negative?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sat, 23 Apr 2011 18:31:42 +0100
Re:  XPath expression for checking that an xs:duration
On 23/04/2011 18:11, David Carlisle wrote:
On 23/04/2011 15:49, Brandon Ibach wrote:
 wouldn't it be sufficient to just
check for the leading minus sign?

yes thought about that afterwords, although hadn't checked if multiple - were allowed. You might need to remove white space first eg with normalize-space)



I think checking for a leading "-" sign (after removing leading whitespace) should do the job. But it's safest to cast explicitly to a string first, since we aren't told whether the <duration> element is typed or untyped.


Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.