Re: XML Base question

Grosso, Paul scripsit:
> I can't imagine we didn't discuss this, but my memory 
> fails me, and I don't see the answer in the spec.
> 
> How, if at all, does xml:base affect the system id of 
> a parsed entity declaration?

Your example is actually an unparsed entity declaration, but I think
the answer is the same in either case.

> Given the following document at /root/mydoc.xml
> (and assuming that the external subset declares 
> entityref as an attribute of type ENTITY):
> 
> <!DOCTYPE doc PUBLIC "some external subset" [
> <!ENTITY logo SYSTEM "graphics/logo.gif" GIF>
> ]>
> <doc>
> <div xml:base="/other/">
> <graphic entityref="logo"/>
> </div>
> </doc>
> 
> 
> is the effective URI used by the graphic element
> 	/root/graphics/logo.gif
> or
> 	/other/graphics/logo.gif

The former.  Determining the base URI is done at the point a relative
reference appears, which in this case is the internal subset.  Since
xml:base cannot affect any part of the DTD, the base URI in effect
in a DTD is that of the document as a whole, namely "/root/".

-- 
John Cowan    cowan@ccil.org    http://ccil.org/~cowan
The whole of Gaul is quartered into three halves.
        --Julius Caesar

Received on Wednesday, 21 October 2009 19:39:57 UTC