CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 22:25:52 GMT
content-type: text/html
content-encoding: gzip
last-modified: Thu, 13 Jul 2023 17:50:23 GMT
cache-control: max-age=2592000, public
expires: Mon, 10 Nov 2025 22:25:52 GMT
vary: Accept-Encoding
access-control-allow-origin: *
x-request-id: 98d1c69cff12741b
strict-transport-security: max-age=15552015; preload
x-frame-options: deny
x-xss-protection: 1; mode=block
cf-cache-status: EXPIRED
set-cookie: __cf_bm=YvRfe5XkPbiXSo.lqO_IefkzdfWT.nMbo4ryjVSnaE4-1760221552-1.0.1.1-HrrgkHoC4j2Yl4_u8yRGiE7d08IuXFXED5OFgKmRvkXE3UtO11O.5k94LqgeJEfsK4Jn_bwkyw_3tJF7l5k2aPWcgAicdGgPSbPaBWhPZJI; path=/; expires=Sat, 11-Oct-25 22:55:52 GMT; domain=.w3.org; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 98d1c69cff12741b-BLR
alt-svc: h3=":443"; ma=86400
[XPath] Dynamic Errors and first-item semantics from Michael Kay on 2004-02-18 (public-qt-comments@w3.org from February 2004)
[XPath] Dynamic Errors and first-item semantics
- From: Michael Kay <mhk@mhk.me.uk>
- Date: Wed, 18 Feb 2004 10:26:02 -0000
- To: <public-qt-comments@w3.org>
- Message-ID: <000101c3f609$9db10af0$6401a8c0@pcukmka>
Sections 2.5.2 and 2.5.3 of the XPath book talk about "dynamic errors", but what they say is equally applicable to type errors raised during the evaluation phase. The examples make this clear: consider "For example, if a function parameter is never used in the body of the function, an implementation may choose whether to evaluate the expression bound to that parameter in a function call." For this example to be correct, the section must apply to all run-time errors, not only to so-called "dynamic errors". (The problem arises because of poor choice of terminology. We tend to imagine that all run-time errors are dynamic errors, but they are not.) While we are on the subject, here is a request for clarification. The expression concat("Title:", //title) raises a type error if the document contains more than one <title> element. Section 2.5.3 says: "an implementation is not required to search for data whose only possible effect on the result would be to raise an error" Assuming that section 2.5.3 applies to type errors as well as to dynamic errors, does this mean that in the above expression, the implementation can output the value of the first <title> element in the document, and avoid searching for any others? If so, we have reintroduced the first-item semantics of XPath 1.0 (and the corresponding efficiency) by the back door, and we should make this explicit, at least by including an example. Michael Kay
Received on Wednesday, 18 February 2004 05:25:23 UTC