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 28241 - most names are specified using the EQName production? most?
Summary: most names are specified using the EQName production? most?
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-19 14:14 UTC by Patrick Durusau
Modified: 2015-07-13 16:57 UTC (History)
1 user (show)

See Also:


Attachments

Description Patrick Durusau 2015-03-19 14:14:45 UTC
2 Basics reads in  part:

"In the XPath 3.1 grammar, *most* names are specified using the EQName production, which allows lexical QNames, and also allows a namespace URI to be specified as a literal:" (emphasis added)

What names are not specified using the EQName production? I didn't see any. If that' correct, suggest:

"Names are specified using the EQName production, which allows lexical QNames, and also allows a namespace URI to be specified as a literal:"

I would remove the self-reference as unnecessary.
Comment 1 Michael Kay 2015-03-19 14:45:23 UTC
>What names are not specified using the EQName production?

The ones that leap out from the page are NCName, QName, and URIQualifiedName. But there are other symbols used to identify things which are not called "names" as such, for example we use the term "namespace URI" for what other specifications call a "namespace name"; and I found at least one place where we speak of "child" as the name of an axis.
Comment 2 Patrick Durusau 2015-03-19 16:05:23 UTC
Thanks! Because then the question becomes why include the "most names" statement at all? When describing a name that is specified by the EQName production, isn't that already noted? That would cover the cases where names may not appear to be names.
Comment 3 Jonathan Robie 2015-03-24 16:37:27 UTC
I think the root problem is that this is trying to define the lexical form of an expanded QName before we have defined that term.  The solution is probably: (1) move the following text so that it occurs before the production (and modify it to make it a better definition), and (2) change the description of the EQName production to make use of this definition:

<proposal>
Names in XQuery 3.1 can be bound to namespaces, and are based on the syntax and semantics defined in [XML Names]. [Definition: An expanded QName consists of an optional namespace URI, a local name, and an optional namespace prefix.] 

In the XQuery 3.1 grammar, expanded QNames are represented by the EQName production.
</proposal>

Is that better?
Comment 4 Michael Kay 2015-03-24 17:58:45 UTC
Well, it's not quite right yet. For example, "names are bound to namespaces" is misleading. Here's my attempt:

The concept of a QName is defined in [XML Names]. XQuery|XPath uses QNames not only for element and attribute names, but also for the names of functions, variables, types, and other constructs.

An *expanded QName* is a triple: its components are a prefix, a local name, and a namespace URI. In the case of a name in no namespace, the namespace URI and prefix are both absent. In the case of a name in the default namespace, the prefix is absent. When comparing two expanded QNames, the prefixes are ignored: the local name parts must be equal under the Unicode Codepoint Collation, and the namespace URI parts must either both be absent, or must be equal under the Unicode Codepoint Collation.

In the XQuery|XPath grammar, QNames representing the names of elements, attributes, functions, variables, types, or other such constructs are written as instances of the grammatical production EQName. This allows a QName to be written in one of three ways:

* local-name only (for example, invoice). A name written in this form has no prefix, and the rules for determining the namespace depend on the context in which the name appears

* prefix plus local-name (for example my:invoice). In this case the prefix and local name of the QName are as written, and the namespace URI is inferred from the prefix by examining the in-scope namespaces in the static context where the QName appears; the context must include a binding for the prefix.

* uri plus local-name (for example Q{http://example.com/ns}invoice). In this case the local name and namespace URI are as written, and the prefix is absent. This way of writing a QName is context-free, which makes it particularly suitable for use in queries|expressions that are generated by software.

The first two forms are referred to as *lexical QNames*; the third form is called a URI-Qualified Name. Collectively they are described by the EQName production in the XQuery|XPath grammar.
Comment 5 Jonathan Robie 2015-03-24 19:15:49 UTC
I like it.  If nobody objects, I'll use that as the resolution of this bug.
Comment 6 Jonathan Robie 2015-07-10 19:30:33 UTC
Fixed in the current HTML build.