RE: [F&O] Function names

-----Original Message-----
From: Noe Michejda [mailto:noe_michejda@7thportal.pl] 
Sent: 01 November 2003 15:16
To: public-qt-comments@w3.org
Subject: [F&O] Function names


NM>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? ...
For example get-local-name-from-QName should be analogous to local-name($n
as node)

MK>A personal view, I'm inclined to agree with you. (At one time, I proposed
that where function names include a data type, we should write them in the
form QName.local-name(), or dateTime.hour(). I still like that idea, but I
don't think it found much favour.)

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

MK>Again, I'm personally inclined to agree. I do find it confusing that some
are singular and some are plural.


NM>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()?

MK>XQuery wanted to have a simpler function. A lot of the complexity of the
document() function is concerned with resolving a relative URI against a
base URI, and that functionality is (rightly) now available in separate
functions, resolve-uri() and base-uri(). This makes it possible to greatly
simplify document(), and XQuery did not want to be unnecessarily constrained
by compatibility with XSLT. The document() function has to be retained in
its existing form in XSLT, but I could see it being deprecated at some time
in the future.

This is just a personal contribution, there will be a proper WG response in
due course.

Regards,

Michael Kay 

Received on Sunday, 2 November 2003 11:17:50 UTC