W3C home > Mailing lists > Public > www-xpath-comments@w3.org > October to December 2000

Re: Must the Literal in a Nodetest be an NCName?

From: James Clark <jjc@jclark.com>
Date: Thu, 02 Nov 2000 08:10:38 +0700
Message-ID: <3A00BF0E.F831AE1D@jclark.com>
To: Kay Michael <Michael.Kay@icl.com>
CC: "'www-xpath-comments@w3.org'" <www-xpath-comments@w3.org>
Kay Michael wrote:

> In XPath section 2.3, is it an error if the literal is not a valid NCName?
> 
> For example, Saxon currently reports no error for
> 
> select="processing-instruction('*')"
> 
> Should it?

No. I see nothing that would justify giving an error.  A warning might
be helpful.

> (It's not clear why the syntax uses a literal rather than an NCName here.

To leave the way open to a generalization of XPath in which
processing-instruction() not only loooks like a function but
semantically is a function.  In general XPath is designed so that things
that look like functions are semantically consistent with function
semantics: a bare NCName as a function argument denotes the node-set of
child elements with that name.

> All other names to be matched are written as QNames rather than literals.

Similar case to system-property() in XSLT.

James
Received on Wednesday, 1 November 2000 23:10:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:54 GMT