Re: [F&O] Function names

Noe,

The XML Query and XSL Working Groups discussed and decided to adopt your
suggestion to eliminate the get- prefix on the functions you cited. 

Discussion is continuing on the other two issues you raised. Those
decisions will be sent separately. 

Pat Case, U.S. Library of Congress

>>> "Noe Michejda" <noe_michejda@7thportal.pl> 11/01/03 10:16 AM >>>
There are few function in spec with 'get-' prefix:
 get-local-name-from-QName
 get-namespace-from-QName
 get-namespace-uri-for-prefix
 get-in-scope-namespaces
 get-xxx-from-xxx

does the prefix carries some meaning? Normally they are used for
getter/setter pairs, but in core all functions are side-effect free.
So why using longer and harder to remember names?
Accessors are very similar set of functions but aren't using 'get-'
prefix.
For example get-local-name-from-QName should be analogous to
local-name($n as node)

Also hour/minute/second extractors should use singular forms.
They are extracting named fields. SQL and most programming libraries
already uses singular forms.

I propose to change those names to:
 local-name-from-QName
 namespace-from-QName
 namespace-for-prefix
 in-scope-namespaces
 hour-from-XXX
 minute-from-XXX
 second-from-XXX
 day-from-XXX
 month-from-XXX
 year-from-XXX

I think expression

//visit[hour-from-time(@time)=12]

looks more natural that

//visit[get-hours-from-time(@time)=12]


Second thing is doc() vs document()
what is the rationale behind having two so similar functions? Especialy
if you are trying
to cut down function number. It could be very confusing for users using
different languages
Plus all functionality is available through another core functions so
there is no extra work for
implementators. Possibly it would be better to drop document(), but its
not possible (compatiblility).
So why not leave just document()?

Regards,
Noe Michejda
7th Portal S.C.

Received on Wednesday, 5 November 2003 22:53:23 UTC