Case of function names (Was: Re: [xsl] comments on December F&O draft)

David Carlisle wrote:
> 6
> I think that all new functions should match the existing xpath
> naming convention, ie lowercase - separated words. When mapping
> names from other languages that have other naming conventions (eg
> camel case) then some extra - may need to be added, and the names
> lowercased. so I thing dateTime should be date-time throughout
> gMonthDay should be g-month-day etc.
>
> especially bad is captial c in get-Century but lowercase h in
> get-hour

I think that you could argue it both ways when the function name
includes the name of a relevant data type from XML Schema, since those
data type names use camel case. It depends on whether you think people
will be more confused by the naming conventions of functions being
unpredictable or by not using the same naming convention when
referring to the built-in data types within function names as you do
when referring to them elsewhere.

Also, the problem with adopting standard XPath naming conventions for
these functions is especially evident when you compare:

 - xf:ID()    and  xf:id()
 - xf:IDREF() and  xf:idref()
 - xf:Name()  and  xf:name()

However, perhaps this issue could be side-stepped by not using
functional syntax for constructors.

I agree completely about xf:get-Century-from-dateTime() and
xf:get-Century-from-date - Century is not an XML Schema data type, so
there's no justification for it being capitalised.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Sunday, 6 January 2002 13:42:31 UTC