Re: [FO] Return value of fn:name ?

On 29 Jul 2013, at 19:56, Buck Golemon wrote:

> It's come to my attention recently that Firefox returns upper-cased strings from the xpath name() function, while other implementations I've surveyed return a not-upper-cased string (I haven't yet checked whether they are forcefully lower-cased or simply untouched).
> 
> Is one of these implementations out of spec?
> 
> I'd like to bring this inconsistency to the attention of implementers and ask them to "fix" it, but I'd want to bring them a definitive specification of Correct behavior.
> 
> If anyone requests a thorough survey of implementation behavior (in regards to fn:name() return value casing) I will do so.
> 
> -buck

XPath is defined to operate on the XPath data model (called XDM in the 2.0 version), in which the case of names is significant. It allows you to construct your XDM model from some other model (for example an HTML DOM), but it doesn't say how this should be done. Presenting all the names as lower case or presenting them all as upper case (or indeed, leaving them as written) are all perfectly acceptable as far as the XPath specification is concerned. If there are standards for mapping the HTML DOM to the XPath model, they aren't to be found here.

Section 3.5 of the HTML5 specification is relevant, though it focusses on namespace issues rather than case-sensitivity:

http://dev.w3.org/html5/spec-LC/apis-in-html-documents.html

You'll notice that they've defined a unilateral change to the XPath spec when applied to HTML5. All a bit of a mess really.

(personal response)

Michael Kay
Saxonica

Received on Thursday, 1 August 2013 13:01:47 UTC