xsl-list
[Top] [All Lists]

RE: [xsl] dateTime fun

2006-12-21 11:46:37

So I'm dealing with a schema which has an attribute:

  <xs:simpleType  name="time">
    <xs:union  memberTypes="
          xs:gYear xs:gYearMonth xs:date xs:dateTime"  />
  </xs:simpleType>

I had to write a function to let someone compare two of these 'time'
simple types.  It appeared as though the only way to do 
comparisions was with equal times, so that mean converting 
everything to xs:dateTime.

For better or worse, the gXX types are very poorly supported by standard
functions and operators. I think the reason for this is that a lot of people
on the WGs felt that (a) these types were of very specialized interest
compared with other primitive types, and (b) date/time handling already had
far too big a share of the function library even without adding these to the
mix. 

It's also true that union types aren't all that well supported in the type
system. You can declare a function that takes as="element(*,time)" or
as="attribute(*,time)" as an argument, but you can't say as="time" because
it's not an atomic type.

So I think I would probably end up with something fairly similar to your
solution.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>