Re: Is inclusion stable?

On Mon, Jan 26, 2004 at 07:27:09PM -0500, Elliotte Rusty Harold wrote:
> 
> I was wondering if there should be a requirement that XInclude be 
> stable? In other words, if the same URI is fetched twice in the 
> process of resolving includes, must/should the representation 
> returned be identical both times? For example,
> 
> <root xmlns:xi="http://www.w3.org/2003/XInclude">
>   <xi:include href="http://www.cafeconleche.org/"/>
>   <xi:include href="http://www.cafeconleche.org/"/>
> </root>
> 
> What if the resource changes between two retrievals? e.g. it has a 
> hit counter of some kind in the document text? or a time stamp? Or 
> perhaps just a frequently changing stock quote?

  Well that question is not answered in the XML specification either,
I don't see why XInclude should. In XML as far as I remember there
is nowhere specified that referencing multiple time an external
parsed entity, the same content should be used each time. This
is implementation dependant at the XML level (though I bet all
implementations reuse the same content for the resource), and I think
it would be stange to require this at the XInclude level (though
again I would expect nost implementations to reuse the same content
for the resource). But I could see case where XInclude processors
operating in embedded systems would give more weight to memory 
consumption than processing costs and no do caching in such an
environment. IMHO it's better left an implementation choice.

> Are implementations allowed to cache the result of the first 
> retrieval? Are they prohibited from doing so? Is it implementation 
> dependent?

  Well I do cache (I got a bug report once where some processing went
from 1 seconds to a couple of minutes because I broke this - and in
conjunction with heavy XPointer use this was totally destroying
performances).

> Then the same question, but the URIs have different fragment IDs; e.g.
> 
> <root xmlns:xi="http://www.w3.org/2003/XInclude">
>   <xi:include href="http://www.cafeconleche.org/#1/3"/>
>   <xi:include href="http://www.cafeconleche.org/#/1/2/4"/>
> </root>

  Same thing, I cache, this is a serious performance requirement in
practice.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | 

Received on Tuesday, 27 January 2004 18:06:17 UTC