xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XPath 2.0 Datatypes namespace


Subject: Re: [xsl] XPath 2.0 Datatypes namespace
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 04 Aug 2006 12:20:11 +0100

>>>>> "tom" == tom tom <tomxsllist@xxxxxxxxxxx> writes:

    tom> Hi all, I wish to calculate the time in another timezone, to
    tom> acheive this I am using the following structure:

    tom> <xsl:sequence
    tom> select="adjust-time-to-timezone(xs:time('10:00:00-04:00'),
    tom> xdt:dayTimeDuration('PT4H'))"/>

    tom> which returns 18:00:00+04:00.

    tom> 1. According to http://www.w3.org/TR/xpath-datamodel/
    tom> xs:dayTimeDuration is a type defined in the
    tom> http://www.w3.org/2001/XMLSchema namespace. Why, then, can I
    tom> only get this to work in the
    tom> http://www.w3.org/2005/xpath-datatypes namespace when using
    tom> Saxon 8?

Because the namespace has only recently changed, and the version of
Saxon you are using does not reflect that change yet.

    tom> 2. Why do I need to declare the datatype atall given that the
    tom> function is expecting a dayTime Duration datatype, ie why can
    tom> I just use:

    tom> <xsl:sequence
    tom> select="adjust-time-to-timezone(xs:time('10:00:00-04:00'),
    tom> PT4H)"/> ?

Because PT4H is a step expression, not a literal.

    tom> 3. Am I unwise to be using this functionality until these
    tom> standards become recommendations?

No. You just have to be prepared to make the occaisional change.
-- 
Colin Adams
Preston Lancashire


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor