W3C home > Mailing lists > Public > xml-dist-app@w3.org > October 2001

Re: FW: Proposed positive text for XML Base

From: Doug Davis <dug@us.ibm.com>
Date: Thu, 18 Oct 2001 07:16:58 -0400
To: "Jonathan Marsh" <jmarsh@microsoft.com>
Cc: <xml-dist-app@w3.org>, "Henrik Frystyk Nielsen" <henrikn@microsoft.com>, "Paul Cotton" <pcotton@microsoft.com>
Message-ID: <OF1CCB32A9.FE47AAA3-ON85256AE9.003D62AC@raleigh.ibm.com >
Looking at example 3:
  <s:envelope>
    <s:body xml:base="http://www.example.com">
      <xhtml:html>
        <xhtml:base href="/dir/"/>
        <xhtml:body>
          <xhtml:a href="test.xml"/>
          The href is http://www.example.org/dir/test.xml.
        </xhtml:body>
      </xhtml:html>
    </s:body>
  </s:envelope>
I'm trying to figure out what this mean internally for a SOAP
processor.  I would imagine that in the non-rpc case most SOAP
processors will just grab the body and pass it along to the
service.  So, if we take the above XML starting at <xhtml:html>
we'd send just:
      <xhtml:html>
        <xhtml:base href="/dir/"/>
        <xhtml:body>
          <xhtml:a href="test.xml"/>
          The href is http://www.example.org/dir/test.xml.
        </xhtml:body>
      </xhtml:html>
to the service.  How does the service resolve these URLs?
Are we going to require them to add an "xml:base" attribute
to the <xhtml:html> element?  That would seem to be invalid,
the SOAP processor shouldn't mess with the data.  Or do we
just leave this up to each implementation as a problem for
them to solve?

I suppose we could look at this as an error case - since
on the client/sender side the original doc (which started
with the <xhtml:html> element) was missing the xml:base
element to start with so the original doc was wrong and
we just happen to get lucky enough that in some intermediate
form (ie. the entire SOAP envelope) it just happened to look
valid.  Is this how you guys thought of it?

-Dug


"Jonathan Marsh" <jmarsh@microsoft.com>@w3.org on 10/17/2001 07:22:04 PM

Sent by:  xml-dist-app-request@w3.org


To:   <xml-dist-app@w3.org>
cc:   "Henrik Frystyk Nielsen" <henrikn@microsoft.com>, "Paul Cotton"
      <pcotton@microsoft.com>
Subject:  FW: Proposed positive text for XML Base



Henrik and Paul consulted with me on this issue, in my role as editor of
the XML Base Recommendation, resulting in an updated proposal based on
David Orchard's text.  Although I am a member of the XML Core WG, and
believe the text below is consistent with the feedback the Core WG provided
on this issue, I do not supply this text under the aegis of the Core WG.  I
hope that this proposal is helpful to the XP WG in considering this issue.


BASE URI's and Relative URI Resolution
--------------------------------------
This version of the SOAP specification supports the W3C XML Base
Recommendation. An xml:base attribute information item MAY appear on any of
the element information items defined in this specification.  This
specification does not make use of URI References, only absolute URIs, so
xml:base attributes will not affect the behavior of the SOAP envelope
itself.  Relative URI values (such as for the SOAP-ENV:EncodingStyle
attribute) are not recognized as matching the absolute URI values mandated
by this specification.

The XML Base specification provides a standard base URI for the contents of
the SOAP-ENV:Body or other header entries.  Specifications for particular
applications of SOAP, as well as specifications for transport bindings,
header entries and/or body entries MAY define the base URI of the SOAP
message interpretation of relative URI's within such body or entries
additionally.  When such mechanisms depend upon the base URI of a higher
context, such as the document, they SHOULD be given the base URI of the
nearest ancestor SOAP envelope element instead.  In the absence of such
additional specifications, the resolution of relative URI's appearing
within the contents of a body or other header entry is defined by XML Base.
It is not recommended that new specifications invent new mechanisms for
adjusting the base URI, since these mechanisms will be in conflict with the
[base URI] infoset property, which only recognizes XML Base.

Namespace declarations for the namespaces used in this specification (such
as http://www.w3.org/2001/06/soap-envelope) MUST be provided as absolute
URI's. Element or attribute names qualified with relative URI namespaces
are not recognized as matching the absolute names mandated by this
specification."


Rationale:
----------
The simplest reading of SOAP 1.2 does not allow relative URIs (specifically
URI References) in any of its attributes.  Making such a change requires
positive motivation.  Use cases demonstrating the value of relative URIs in
each circumstance should be found before considering a change.  XML Base is
a tool for interpreting URI References, and its availability does not mean
that all URIs benefit from becoming URI References.

Here is how the proposal above supports the various flavors of base URI
calculation:

1) Some payloads will support XML Base.  For example, the payload1 grammar
allows xml:base attributes and recognizes XML Base:

<s:envelope>
  <s:body xml:base="http://www.example.com">
    <payload1 ref="test.xml" xml:base="/dir/">
      This grammar honors XML Base.
      The ref is http://www.example.com/dir/test.xml.
    </payload1>
  </s:body>
</s:envelope>

The proposal is optimized for this case.  The [base URI] property of the
infoset reliably allows relative references to be resolved.

2) Payloads that don't allow xml:base attributes, and assume the document
URI is the base, have a clean interaction with the envelope.  Relative URIs
must be interpreted relative to the base URI of the SOAP envelope element.
For example, the payload2 grammar does not recognize XML Base or allow
xml:base attributes:

<s:envelope>
  <s:body xml:base="http://www.example.com">
    <payload2 ref="test.xml">
      This grammar does not honor XML Base, or allow xml:base attributes.
      The ref is http://www.example.com/test.xml, not <message
base>/test.xml.
    </payload1>
  </s:body>
</s:envelope>

3) Payloads that provide a different mechanism for determining XML Base,
also have a clean interface with the envelope:

<s:envelope>
  <s:body xml:base="http://www.example.com">
    <xhtml:html>
      <xhtml:base href="/dir/"/>
      <xhtml:body>
        <xhtml:a href="test.xml"/>
        The href is http://www.example.org/dir/test.xml.
      </xhtml:body>
    </xhtml:html>
  </s:body>
</s:envelope>

Note that relative URIs for the base are not actually allowed in XHTML.
Note that the [base URI] property of the <xhtml:a> element is
http://www.example.com, although an XHTML application would instead treat
it as http://www.example.com/dir/.  New specifications should avoid
specifying such mechanisms, because processing the relative URI using a
generic processor rather than an application-specific processor will
provide different results.


-----Original Message-----
From: David Orchard [mailto:david.orchard@bea.com]
Sent: Friday, October 05, 2001 17:17
To: xml-dist-app@w3.org
Subject: Proposed positive text for XML Base
I took Noah's excellent wording[1] and semantically NOTed it.  My attempt
follows.  Please note that this wording defines that relative URI's ARE
interpreted according to xml:base, therefore implementations must support
xml:base.  It seems to me that an application that doesn't support xml:base
but supports relative URIs is an undefined state.

BASE URI's and Relative URI Resolution
--------------------------------------
"This version of the SOAP specification supports the W3C XML Base
Recommendation. The xml:base attribute MAY appear on the SOAP-ENV:Envelope,
SOAP-ENV:Body, SOAP-ENV:Header, or SOAP-ENV:Fault elements.

The XML Base specification provides a standard Base URI for the contents of
the SOAP-ENV:Body or other header entries.  Specifications for particular
applications of SOAP, as well as specifications for transport bindings,
header entries and/or body entries MAY define the interpretation of
relative URI's within such body or entries additionally. In the absence of
such additional specifications, the resolution of relative URI's appearing
within the contents of a body or other header entry is defined by XML Base.

Relative URI's MAY be used as values for attributes or elements (such as
SOAP-ENV:Actor, SOAP-ENV:EncodingStyle) defined by this specification; if
such values are used, their resolution to absolute URI's is defined
according to the XML Base Recommendation.

Namespace declarations for the namespaces used in this specification (such
as http://www.w3.org/2001/06/soap-envelope) MUST be provided as absolute
URI's. Element or attribute names qualified with relative URI namespaces
are not recognized as matching the absolute names mandated by this
specification."

Cheers,
Dave Orchard

[1] http://lists.w3.org/Archives/Public/xml-dist-app/2001Aug/0268.html
Received on Thursday, 18 October 2001 07:18:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:04 GMT