xsl-list
[Top] [All Lists]

Re: [xsl] current-dateTime()

2008-04-18 07:47:21
Robert Koberg schrieb:
You could make a call with the document function (in a non-functional
way :) ) to a back end that uses a custom uri resolver that, when
receives a certain href, logs/writes the /real/ current-dateTime and
returns <nothing/>.

That would probably not work. I tested this the other day, just out of
curiosity, calling a script that incremented a number, and found that
the result was cached when using LibXSLT, Saxon and Xalan.

mludwig(_at_)forelle:~/Werkstatt/xsl > expand -t2 ~/www/xml.php
<?php
$fnam = 'xml.php.dat';
if (file_exists($fnam)) {
  $i = file_get_contents($fnam);
  file_put_contents($fnam, $i + 1);
}
else {
  $i = 0;
  file_put_contents($fnam, $i);
}
echo "<Int>$i</Int>\n";

mludwig(_at_)forelle:~/Werkstatt/xsl > expand -t2 document-function-en.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output indent="yes"/>
  <xsl:variable name="url" select="'http://localhost/mlu/xml.php'"/>
  <xsl:template match="/">
    <Urmel>
      <Prozessor>
        <xsl:value-of select="system-property('xsl:vendor')"/>
      </Prozessor>
      <Frage> Is the result of the call to document() cached? </Frage>
      <xsl:copy-of select="document($url)"/>
      <xsl:copy-of select="document($url)"/>
      <xsl:copy-of select="document($url)"/>
<Antwort> Yes, it is. LibXSLT, Xalan and Saxon cache the result.</Antwort>
    </Urmel>
  </xsl:template>
</xsl:transform>

mludwig(_at_)forelle:~/Werkstatt/xsl > xsltproc document-function-en.xsl urmel.xml
<?xml version="1.0"?>
<Urmel>
  <Prozessor>libxslt</Prozessor>
  <Frage> Is the result of the call to document() cached? </Frage>
  <Int>52</Int>
  <Int>52</Int>
  <Int>52</Int>
<Antwort> Yes, it is. LibXSLT, Xalan and Saxon cache the result.</Antwort>
</Urmel>

Michael

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>