This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28811 - [SER 3.1] Serializing function items in the adaptive method
Summary: [SER 3.1] Serializing function items in the adaptive method
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 3.1 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Andrew Coleman
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-15 09:12 UTC by Michael Kay
Modified: 2015-06-19 08:48 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2015-06-15 09:12:25 UTC
It's not clear in the adaptive method how the QName of a function is to be handled. The text says

A function item is serialized to the representation "function fn:name#A" where fn:name is the function name and A is the arity. If the function is anonymous, fn:name is replaced by the string "(anonymous)".
Note:
The following examples illustrate this rule:
exists#1 is serialized as function exists#1
fn:exists#1 is serialized as function fn:exists#1
Q{http://www.w3.org/2005/xpath-functions}exists#1 is serialized as function exists#1

Now, "fn:name" suggests using a lexical QName. But the examples then confuse this. What is "exists#1"? If we assume the default namespace for functions, it's the same thing as "fn:exists#1". The system can't be expected to remember how the QName was originally written.

I suggest:

A function item is serialized to the representation "function name#A" where name is a representation of the function name and A is the arity. If the function name is in one of the namespaces (...) then the name is output as a lexical QName using the conventional prefix "fn", "math", "map", "array", or "xs" as appropriate; if it is in any other namespace or in no namespace, then the name is output as a URI-qualified name (that is, "Q{uri}local"). If the function is anonymous, name is replaced by the string "(anonymous)".
Comment 1 Andrew Coleman 2015-06-19 08:48:07 UTC
At the teleconference on 2015-06-16, the WG agreed to adopt the proposed wording.