Re: Context and... Re: the case of two bats

Sorting this out has clarified my thinking. I had stated that the
parent-element's namespace name ought to be considered part of the context.
I now propose that the string representation of the context be defined as:

base URI + '#' + xpointer to current node.

Tim Berners-Lee wrote:

> Or were you pointing out hat in this case, as these are within the same
> document, the URI references are the same, clearly the URIs will
> be the same, no matter what the URI, and it would be of course fine
> for software to make that assumption?

Actually I am saying that the XSLT/XPath/XPointer definition of "context" is
with reference to the "current node" not just the base URI.

If we are talking HTML the implied context is the base URI / directory. So
it is perfectly intuitive to expect that
<h:a img="../images/whatever.jpeg" /> refers to a jpeg document located
relative to the HTML document in the directory structure of the web site.

But in XPath/XSLT/XPointer context is defined as the current node within the
base document:

XSLT: "In XSLT, an outermost expression (i.e. an expression that is not part
of another expression) gets its context as follows:

    the context node comes from the current node ..."

XPath: "Expression evaluation occurs with respect to a context. XSLT and
XPointer specify how the context is determined for XPath expressions used in
XSLT and XPointer respectively. The context consists of:

    a node (the context node) ..."


"5.2 Evaluation Context Initialization
An XPointer is evaluated to yield an object of type location-set. This
evaluation is carried out within a context identical to the XPath evaluation
context, except for the generalization of nodes to locations. ".


So, I assume that the term "context" is being used as in XSLT/XPath/XPointer
to mean the "current node" not the base URI.

This is intuitive to me. The bat example with 2 documents was used to point
out a semantic inconsistency created when literally compares a relative URI
reference between 2 documents.

I merely pointed out that the exact same semantic inconsistency exists when
a relative URI reference is literally compared within the same document
***when the base URI and hence absolute URI is identical but the context is
different***. In summary, I agree with the proposed wording but wish to
clarify that the context ought be defined in the same way it has been
defined by XSLT/XPath/XPointer.

Under the proposal, two relative URI references can be compared as namespace
names using:

base URI + '#' + xpointer(current-node) + relative URI reference

Jonathan Borden

Received on Wednesday, 14 June 2000 19:21:45 UTC