Re: A proposed solution

Henrik Frystyk Nielsen wrote:

> > > Not at all - it merely states that you can't use relative URIs
> without
> > > taking the context within which they are defined into account. Note
> that
> > > this doesn't mean that you necessarily have to explicitly
> absolutize.
> >
> > The proposed solution is then to treat the namespace names
> > literally; but put a big sign in the namespace rec?
>
> Nope, the proposal is much simpler: it merely clarifies that a namespace
> identifier is a URI. Some URIs are relative which means that they are
> defined within a context. In order for you to deal with relative URIs
> you have to be aware of the context (for example "the current
> document"). The warning is that you can't take the relative URI out of
> context and still expect it to be a unique identifier outside the
> context.

    This is wonderfully sensible, but raises yet a few more questions.

    What now seems like ages ago, I suggested that relative URI references
be interpreted w.r.t. the current element, and was prompty shot down in that
the absolutization of relative URI references is explicitly defined in RFC
2396.

    Yet if we expect to use a relative URI reference to locate a resource
within an XML document, the relative URI reference needs to be interpreted
w.r.t the current element context *NOT* the base URI.

    E.g.:

    <root>
        <schema example="apple">
            ...
        </schema>
        <child1 xmlns="../schema">
                <schema example="orange">
                        ....
                </schema>
                <grandchild xmlns="../schema">
                    ..
                </grandchild>
        </child1>
        <child2 xmlns="../schema">
        </child2>
    </root>

So the million $$ question: do "child1" and "grandchild" have the same
namespace URI or not? Child1 and child2?

The term "context" needs to be defined as it pertains to the proposed
solution. I strongly suggest that this be done as a function of the infoset.
For example:

"The context of a namespace name is the infoset of the parent node of the
element in which the namespace is defined. In the case of the document
element the context is the base URI of the document. Namespace names are
equal if they are equal by string comparision and if the namespace names are
relative URI references, that they have equal contexts."

Jonathan Borden
>

Received on Friday, 9 June 2000 14:20:20 UTC