RE: [xsl] Timezone concept broken in XPath 2.0?

Subject: RE: [xsl] Timezone concept broken in XPath 2.0?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 10 Nov 2008 11:01:30 -0000
> It's easy enough to do it yourself. The reason I posted is 
> rather that whether or not adjust-dateTime-to-timezone($dt) 
> and its two fellows in XPath 2.0 return a correct result for 
> a given point in time $dt depends on whether or not the 
> offset from UTC at the time of processing matches the offset 
> from UTC in effect at $dt - and this strikes me as odd.

There are a zillion features that aren't supported in the XPath function
library. After all, it only contains a little over 100 functions: by way of
comparison, the Java class library contains over 3700 classes, and
heaven-knows how many methods. So the fact that the function you want is not
present is not something one can regard as a bug. 

The fact that civil timezones aren't supported is largely because they
aren't supported in XML Schema, which in turn is because they aren't
supported in ISO 8601. 

Although it's true that many applications have to cope with civil time
displacements, it's equally true that many applications have to cope with
changing tax rates and exchange rates. Would you expect a generic function
library to know about such things? I think there is something in the
argument that this kind of thing belongs more in the application layer than
the technology layer. 

There are many practical difficulties. How would we specify the result of
such functions (by reference to the Olson database, or by reference to the
decisions of national governments?) How far into the past and the future
would we expect an implementation to have information about civil time zone
displacements? Would we require the information to be available for the
whole world, or only those parts of the world that a particular vendor is
interested in? Would we need to have conformance rules requiring an
implementation to be updated within N days of a legislative change (or a
change to the Olson database?) What happens when there is disputed
authority, e.g. as in Tibet?

Michael Kay

Current Thread