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

Re: xdt:dayTimeDuration casting issue

Subject: Re: xdt:dayTimeDuration casting issue
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 8 Mar 2007 15:09:40 +0000
Re:  xdt:dayTimeDuration casting issue
On 3/8/07, Laura Porter <lporter@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

I am using Saxon 8.7.3J and having an issue casting a string to
xdt:dayTimeDuration for use in  days-from-duration()

The error I'm getting is:

Cannot find a matching 1-argument function named
{http://www.w3.org/2005/xpath-datatypes}dayTimeDuration()

I've checked that the namespace is correct
(xmlns:xdt=http://www.w3.org/2005/xpath-datatypes). The exact usage is:

<xsl:value-of
select="days-from-duration(xdt:dayTimeDuration(dates/duration))"/> where
dates/duration is P0Y3M3DT12H

When I run that example with Saxon 8.7.3b I get the error:


 FORG0001: Invalid duration value 'P0Y3M3DT12H' (non-numeric or
out-of-range component)

..so your duration value isn't valid.  You appear to have included
years and months, whereas it only allows days and a time (the allowed
format is "PnDTnHnMnS") see:

http://www.w3.org/TR/xpath-functions/#dt-dayTimeDuration

Also, I believe the only prefix to use these days is xs:* (although
Saxon seems to work with both).

cheers
andrew

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.