xsl-list
[Top] [All Lists]

RE: [xsl] The generic numeric datatype

2007-07-23 00:34:47
To maintain the strongest possible typing and semantics when 
defining user functions via xsl:function, what standard 
datatype should be used for 'numeric' in the absence of a 
standard numeric predefined type?

Unfortunately, there's not much you can do. Either define multiple functions
with different names, or use xs:anyAtomicType.

One would not think it to be a significant effort had 
something like xs:numeric or xs:anyNumericType be included in 
the spec.

You'd be surprised. Much smaller things than this have been a significant
effort; you should have listened to the discussion on leap seconds. The
explanation for the problem lies in the history: the fact that the primitive
types were defined by the XML Schema Working group and predated the creation
of a function library to operate on the types.

Another and perhaps more general solution would be allow union types to be
used in a function signature; this would allow the introduction of types
such as xs:numeric without changing the type hierarchy.

Feel free to raise a comment against the specs in a bugzilla entry.

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>