Re: [xsl] XPath expression for checking that an xs:duration value is not negative?

Subject: Re: [xsl] 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
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