Re: [xml] lazy libxml

Daniel Veillard <veillard redhat com> writes:

Consider this example of imagined XRT:

   <xsl:variable name="pngfile"  select="lazy.get('adabyron.png')"/>
   <xsl:variable name="jpgfile" select="lazy.convert($pngfile, 'jpg')"/>

The idea here is that there is a lazy object representing the
pngfile which is then converted to another lazy object which
represents a jpg file.

  Embedding the full image in the XML does not make sense to me:

    - it's inefficient in bandwidth (HTTP can transport binary fine)

XRT with lazy XML would be able to do all this very efficiently
because the eventual serialization of the lazy Element would be just
the same as a file pull in a webserver.

    - it defeats all potential caching in HTTP from server to client

 Technologically this sounds wrong to me from an content service over HTTP
perspective, but my opinion is only that.

XRT is syntax for processing requests. If a request is for a png file
(or a jpg file) then it should return the data.

This has nothing to do with embedding binary data in XML or HTML sent
to the client or with caching ; XRT still implements cache

But the syntax for describing binary data efficiently is what I want
lazy XML for.

FWIW SXML already has an understanding of lazy XML I believe:

  first time I heard of SXML. Well they use high level language to 
process the content, adding this kind of extensions may be easier
for them.

There is another implementation strategy I thought of. dyn:evaluate
could be used to force evaluation of a lazily expressed function call;

  <xsl:variable name="lazy" select="'somecall(value)'"/>
  <xsl:value-of select="dyn:evaluate($lazy)"/>

The trouble with this is that $lazy is just a string. It would be nice
to have some type 'delayed xpath expression' so I could establish
programatically that a certain node in a DOM is a delayed

Perhaps I could do that though... either by having a delay function
which returns a namesapced nodeset (with the namespace indicating
lazyness) or by having a new type entirely.

Nic Ferrier   for all your tapsell ferrier needs

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]