W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > May 2006

Re: c14n: dot-dot path segment removal resulting in xml:base="" should result in xml:base="./"

From: Jose Kahan <jose.kahan@w3.org>
Date: Wed, 24 May 2006 16:59:39 +0200
To: Konrad Lanz <Konrad.Lanz@iaik.tugraz.at>
Cc: public-xml-core-wg@w3.org
Message-ID: <20060524145939.GJ5588@rakahanga.inrialpes.fr>

Hi!

As a follow-up to Konrad's message, here are some notes I wrote
after spending time thinking about xml:base cases. I think there are some
ambiguous cases.

I hope my notes are not so ambiguous as those cases :)

-jose

1. Three equivalent ways of describing the current document location, when
   there is no other xml:base preceding a given element

  a) No xml:base
  b) xml:base=""
  c) xml:base="./"

  Example: 

   <foo>
     <a>
        <b xml:base="./">
        </b>
     </a>
   </foo>

  If there is a previous xml:base in the tree hierarchy, then the above
point to it
  
   <foo xml:base="http://example.com/path/to/document.ext" >
     <a>
        <b xml:base="./">
        </b>
     </a>
   </foo>

   b's base is equivalent to http://example.com/path/to/

2. Canonicalization of xml:base should remove the document extension.
   --> xml:base is used to resolve relative URIs

     <a xml:base="http://example.com/path/to/document.ext" >

   should be canonicalized as

     <a xml:base="http://example.com/path/to/" >

3. Ambiguity case: simplification of relative URIs, moving to the top

   <foo xml:base="abc/file.ext">
     <a xml:base="something/" >
        <b xml:base="../../">
        </b>
     </a>
   </foo>

   Stripping out <foo> and <a> would give

   <b xml:base="abc/something/../../">
   </b>

   This points to the path that is parent of abc. However if this is
   simplified as:
   
    <b xml:base="">
    </b>

   We don't know if we're talking about the path parent of abc or the
   current location of b.

   If I've another fragment:

   <foo>
     <a>
        <b xml:base="">
        </b>
     </a>
   </foo>

  If I strip out b, I would have the same C14N result. However, in this
  case, b's base is referring to things relative to the document. In 
  the previous one, b's base refer's to things relative to the parent of b.

  In comparition, in a web server, relative URIs cannot go beyond the
  server's document root.

3. Open issues

   a) What is the meaning of canonicalization of relative URIs. Should
      they become absolute ones?
   b) Up to to when does simplification of cascaded relative URIs in 
      xml:base make sense?
   c) Do we need something to precise what is the meaning/equivalence of
      xml:base="./" and xml:base="", both in cases where there is a parent
      element with an xml:base and where there is none?
   d) Should the C14N of an xml:base always remove anything that is not a
      path?  (All that follows the last /)
Received on Wednesday, 24 May 2006 15:00:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:33 GMT