F&O - Is extract(month, myDateTimeItem) possible?

I and a friend have been independently exploring the date-time functions in 
XPath 2.0 / XQuery 1.0. They are very tedious to hand code.

Looking at this from a coder's point of view, it would be much nicer to have 
something like,

extract(someDesiredDateComponent, someDateTimeItem)

rather than a mulitiplicity of
get-somethingInteresting-from-gHorribleKludge() functions.

So, would it be possible to replace the panoply of component extraction 
functions with, for example,

extract(month, myItemName)

the first argument being all legal components (seconds, minutes, timezone 
etc) and the second argument being simply an item name (not even requiring a 
coder to master all the gHorribleKludge types), with the item having to be a 
date-time type?

So I guess I am asking several questions:

1. Is there a good reason for having the multiplicity of dateTime component 
extraction functions as separate functions?
2. Is there a compelling technical reason why extract(month, myDateTimeItem) 
couldn't work or is perceived as technically inferior?
3. Depending on the answers to 1. and 2. is the WG willing to consider a more 
compact syntax requiring fewer date-time component extraction functions?

I appreciate that we are now 5.5 months into the nominal "3 month" WD cycle, 
so I guess a new batch of WDs will arrive soon, so even if found worth 
exploring I accept that any acceptance of the idea won't be immediately 
expressed in a WD.

I would be interested in the WG's comments.

Andrew Watt

Received on Friday, 2 May 2003 02:16:53 UTC