W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > April to June 2000

RE: XML Base and XPath absolutizing of URIs

From: John Boyer <jboyer@PureEdge.com>
Date: Thu, 8 Jun 2000 16:33:11 -0700
To: "Paul Grosso" <pgrosso@arbortext.com>, "Joseph M. Reagle Jr." <reagle@w3.org>
Cc: "XML DSig" <w3c-ietf-xmldsig@w3.org>, <elm@east.sun.com>, <xml-uri@w3.org>, <www-xpath-comments@w3.org>, <www-xml-linking-comments@w3.org>, <Daniel.Veillard@w3.org>, <connolly@w3.org>
Message-ID: <BFEDKCINEPLBDLODCODKMEDJCDAA.jboyer@PureEdge.com>
Hi Paul,

Yes, absolutely no problem with XBase.  The connection to XBase comes from
the fact that XLink is considered to be dependent on XBase.  Since XLink is
also based on XPointer, which in turn is based on XPath, one naturally
concludes that XBase may impact XPath.

Why?  If XPath does not define a way to specify a base URI, then the sudden
appearance of XBase might fill the gap.  If XPath does define a way to
specify a base URI, then the sudden appearance of XBase might contradict the
defined method.

As for whether XPath defines a method for specifying a base URI, it does
not.  The fact that a reference to RFC 2396 appears in the same paragraph as
the text that states XPath must absolutize namespace URIs is irrelevant
because the reference appears first.  The exact quote is:

"The namespace URI specified in the XML document can be a URI reference as
defined in [RFC2396]; this means it can have a fragment identifier and can
be relative. A relative URI should be resolved into an absolute URI during
namespace processing: the namespace URIs of expanded-names of nodes in the
data model should be absolute."

The paragraph says that a namespace declaration can be a URI reference, and
that URI-references are defined by RFC2396.  The conversion from relative to
absolute URIs is claimed to occur during namespace processing. The
namespaces spec does not define this!  Moreover, the problem with claiming
that RFC 2396 defines how to do this is that RFC2396 only describes the
rules for establishing a base URL for a document and how to convert from
relative to absolute URI *given a base URL* (sections 5.1 and 5.2
respectively).  There is nothing to say how an Xpath evaluation is supposed
to receive the base URL.

Put another way, consider the following quote from the XPath Recommendation:

"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)
a pair of non-zero positive integers (the context position and the context
size)
a set of variable bindings
a function library
the set of namespace declarations in scope for the expression"

Where is the base URL in this input specification?

The only thing I can think of is that software external to an XPath
implementation must know the base URL using the rules established by RFC
2396.  Further, since there is no way to communicate the base URL to XPath,
the external software must apply the relative-to-absolute conversion rules
defined in RFC2396 to the data structures it creates in support of setting
up the context node.  Therefore, by the time you get to code that is
actually part of the XPath implementation, the namespace absolutization has
already been done by the external code, and the XPath implementation just
treats them like strings.

Conclusion: Since there is no way defined by the XPath spec to provide the
base URL as part of the initial evaluation context, there is no way for the
XPath evaluation to enforce absolute URIs.  They're just strings to the
XPath evaluator.  Thus, the external, application-dependent code that must
absolutize can also choose not to do it.  Since XPath is in violation of the
namespaces spec anyway for trying to absolutize URIs, the feature should be
removed by an erratum.  Alternately, XPath could be modified by an erratum
to indicate either that the base URL is provided by XBase or as an
additional component of the evaluation context.

One way or the other, something about XPath needs to be changed.

John Boyer
Software Development Manager
PureEdge Solutions Inc. (formerly UWI.Com)
Creating Binding E-Commerce
jboyer@PureEdge.com



-----Original Message-----
From: w3c-ietf-xmldsig-request@w3.org
[mailto:w3c-ietf-xmldsig-request@w3.org]On Behalf Of Paul Grosso
Sent: Thursday, June 08, 2000 3:36 PM
To: John Boyer; Joseph M. Reagle Jr.
Cc: XML DSig; elm@east.sun.com; xml-uri@w3.org;
www-xpath-comments@w3.org; www-xml-linking-comments@w3.org;
Daniel.Veillard@w3.org; connolly@w3.org
Subject: Re: XML Base and XPath absolutizing of URIs


At 14:43 2000 06 08 -0700, John Boyer wrote:
>As you know there is a wonderful debate in the W3C community now about
>whether or not namespace URIs should be absolutized.  I'm not on the
xml-uri
>list, but have mailed this anyway.  Perhaps you could consider posting this
>for me if it doesn't show up there.

It did show up, and I'm replying to all, but this cross posting
may quickly get unwieldy.  I'll try to be brief and address just
your XML Base issue.

>The newest XBase spec does not mention XPath in the list of affected
>specifications, but it is claimed that XBase is required by XLink, which
>relies on XPath.

XML Base merely defines a way in XML (analogous to what the <base> element
in HTML does for HTML files) to specify the value of the base URI per
section "5.1.1. Base URI within Document Content" in RFC 2396 [1].  It
says nothing--beyond normatively referencing 2396--about what you do
with the base URI.  As such, XML Base does not in any way affect XPath.

>The XPath Recommendation states that URIs are absolutized, but no mechanism
>for specifying the base URL is given.

Not quite true.  In the same paragraph that it discusses absolutization,
it normatively references RFC 2396 which precisely defines absolutization.

>I need to know as soon as possible
>whether an erratum to XPath will be issued to state that XBase will be the
>way of doing it.  Alternately, will there be an erratum stating that XPath
>does not absolutize URIs?

I assume you are referring only to the absolutization of namespace URIs.
This is the big question of the moment.  But note that XML Base is
unaffected by the outcome.  XML Base is still useful for providing
a base URI for relative URIs that get absolutized, and the question
of whether namespace URIs are among those that (1) can be relative
and, if so, (2) get absolutized, does not change XML Base at all.

>It is very important to our dsig implementers, whose XPath implementations
>seem not to absolutize URIs.

Well, that is ironic and interesting information, since it's XPath
that says they do get absolutized and would need to be changed if
we decide not to absolutize them.  It sounds like you have more of
an issue with XPath and/or its (non-conforming) implementations,
but you don't have one with XML Base.

paul

[1] http://www.ietf.org/rfc/rfc2396.txt
Received on Thursday, 8 June 2000 19:33:35 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.29 : Thursday, 13 January 2005 12:10:09 GMT