RE: XInclude namespace mappings

Comments below:

> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo@metalab.unc.edu]
> Sent: Wednesday, May 29, 2002 6:24 PM
> To: www-xml-xinclude-comments@w3.org
> Subject: XInclude namespace mappings
> 
> 
> Here's an implementation experience that's causing me some small
> trouble. The issue occurs as an XInclude user rather than as an
> implementer of XInclude.
> 
> I have a DocBook document split into multiple chapters. I use XInclude
> to merge them. The final result should be valid according to the
> standard DocBook DTD, which doesn't know squat about namespaces or
> XInclude. However, the result isn't valid against the standard DocBook
> DTD because the merged document contains lots of
> xmlns:xinclude="http://www.w3.org/2001/XInclude" attributes. e.g. what
> should be
> 
> <book>
> ...
> </book>
> 
> is instead
> 
> <book xmlns:xinclude='http://www.w3.org/2001/XInclude'>
> ...
> </book>
> 
> This namespace declaration is no longer needed in the merged document,
> but it's there becuse it was in the original source documents.

So DTDs and namespaces don't mix?  I'm shocked! Shocked, I say!

Anyway, there is a workaround of sorts - don't scope the XInclude
namespace outside of where it should be used.  For instance, instead of:

  <book xmlns:xinclude='http://www.w3.org/2001/XInclude'>
    <xinclude:include href="foo"/>
    ...
  </book>

use

  <book>
    <xinclude:include href="foo" 
           xmlns:xinclude='http://www.w3.org/2001/XInclude'/>
    ...
  </book>

or even better:

  <book>
    <include href="foo" xmlns='http://www.w3.org/2001/XInclude'>
      <fallback>
        <something xmlns=""/>
      </fallback>
    </include>
    ...
  </book>

No trace of XInclude namespace should remain in the resulting doc.  This
doesn't seem any worse than the other constraints you must follow when
using DTDs and namespaces.

> I wonder if the XInclude namespace should be speciifcally excluded
from
> the result infoset? Is there any plausible reason to keep it?

It's worth considering.

> This brings up another point: section 5.3 does not require in-scope
> namespaces or namespace declaration attribute properties of element
> information items to be provided. However, section 4.5.4, Namespace
fixup,
> seems to require these properties. I'm not sure which section is in
error
> or whether there's some tricky point here I'm not understanding that's
> allows them not to contradict each other. Clarification would be
> appreciated.

The intention is not to require that these properties be provided in the
input, or exposed in the result, but to describe in an interoperable
fashion the value of the properties for processors that expose them.  Is
there something we could do to make the text clearer on this point?

> --
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+
> |           The XML Bible, 2nd Edition (IDG Books, 2001)             |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     |
> |  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
> +----------------------------------+---------------------------------+
> 

Received on Friday, 31 May 2002 19:04:45 UTC