Skip to content

Testing whether a path exists

The test answers for every path, including the two that have no obvious answer: one that cannot be walked, and one with nothing in it.

The rule

Normative: this is the rule
  1. Testing a path for existence MUST report whether that path can be read.
  2. It MUST answer for every path.
  3. A path that cannot be read MUST report absence.
  4. A property path applied to a scalar is such a path, since a scalar has no property to read (LANG-8).
  5. The empty path consumes no segments and therefore denotes the evaluation context itself, which is always present, so the empty path MUST report presence.

Why

Recorded under OPEN-25.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · LANG-20 · changed in spec 1.0